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

Support express style routing with trailing wildcard #561

Open
graforlock opened this issue Sep 14, 2017 · 3 comments
Open

Support express style routing with trailing wildcard #561

graforlock opened this issue Sep 14, 2017 · 3 comments

Comments

@graforlock
Copy link
Member

graforlock commented Sep 14, 2017

Expected behavior

/route/match* is a standard behavior.

Actual behavior

/route/match* breaks the router.

Steps to reproduce behavior

If you do /route/match* , and then navigate to /route/match/ or /route/match you get an error in both cases. So, you need to double up with:

/route/match
/route/match/*

And this creates discrepancy between express and choo methodology which is visible especially when passing routes down to choo from express level to accomplish SSR.

@graforlock graforlock changed the title Support express style routing Support express style routing with trailing wildcard Sep 14, 2017
@bcomnes
Copy link
Collaborator

bcomnes commented Sep 14, 2017

Probably would need to make https://github.com/choojs/nanorouter support this

@graforlock
Copy link
Member Author

graforlock commented Sep 15, 2017

Yeah I will have a look and submit PR for nanorouter whenever I can.

@marcbachmann
Copy link
Contributor

Would you expect this to also match against /route/matchsomething?

FUI I guess nanorouter will never support all patterns express supports. express has a very complex router that also supports a regexes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants