Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong routes when passing a path as an argument #30

Closed
Angelmmiguel opened this issue Nov 14, 2022 · 0 comments · Fixed by #32
Closed

Fix wrong routes when passing a path as an argument #30

Angelmmiguel opened this issue Nov 14, 2022 · 0 comments · Fixed by #32
Assignees
Labels
🐛 bug Something isn't working

Comments

@Angelmmiguel
Copy link
Contributor

Angelmmiguel commented Nov 14, 2022

From #3 and #29

When passing a path to wws (like wws ./examples), it should load the files starting from that route and assign the HTTP endpoint from it too. Currently, this is not the case and running wws ./examples when ./examples/handler.js exists will assign the /examples/handler route instead of the desired /handler.

The issue is located at:

let parsed_path: String = api_path

Here we are removing base_path from api_path, but in this case the string doesn't match properly:

api_path: examples/handler.js
base_path: ./examples/

In addition to that, in #3 @assambar described an issue when the folder does not include the trailing /. The trailing slash should be optional, so we need to fix that issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant