choo
choo copied to clipboard
Support express style routing with trailing wildcard
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.
Probably would need to make https://github.com/choojs/nanorouter support this
Yeah I will have a look and submit PR for nanorouter whenever I can.
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.