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

No way to handle root routes with route: {prefix: '...'} #1720

Closed
alexgorbatchev opened this issue Jun 14, 2014 · 4 comments
Closed

No way to handle root routes with route: {prefix: '...'} #1720

alexgorbatchev opened this issue Jun 14, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@alexgorbatchev
Copy link
Contributor

@alexgorbatchev alexgorbatchev commented Jun 14, 2014

If i'm registering a plugin using route: { prefix: '/foo' } there's no way for plugin to handle /foo because when plugin creates a route on / it only responds on to /foo/ request but not to /foo.

This means that if I'm trying to modularize my application, every module home page can only be /module/ instead of /module 💩

@alexgorbatchev alexgorbatchev changed the title No wait to handle root with route prefix No way to handle root with route prefix Jun 14, 2014
@alexgorbatchev alexgorbatchev changed the title No way to handle root with route prefix No way to handle root routes with route: {prefix: '...'} Jun 14, 2014
@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Jun 15, 2014

Interesting. I think your expectation is correct but also a special case.

@hueniverse hueniverse added the bug label Jun 15, 2014
@alexgorbatchev
Copy link
Contributor Author

@alexgorbatchev alexgorbatchev commented Jun 15, 2014

Is this something that could be fixed? Express handles this as expected.

Also, I'm wondering if i'm using plugins the right way then if you say this is a special case. I'm breaking up modules like admin panels into plugins and then mount them into the app.

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Jun 15, 2014

The prefix feature is brand new. Sounds like you are doing the right thing. It is a special case because all other paths are just string concat. I am going to treat this as a bug and fix it to use just the prefix if the path is /.

@hueniverse hueniverse added this to the 6.0.2 milestone Jun 15, 2014
@hueniverse hueniverse self-assigned this Jun 15, 2014
@alexgorbatchev
Copy link
Contributor Author

@alexgorbatchev alexgorbatchev commented Jun 16, 2014

Thanks! Really appreciate this!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants