javascript-route-matcher
javascript-route-matcher copied to clipboard
optional extra route?
var route = routeMatcher("user/:a/:b");
route.parse('user'); // should work
route.parse('user/foo'); // should work (currently doesn't)
route.parse('user/foo/'); // should work
route.parse('user/foo/bar'); // should work
route.parse('user/foo/bar/'); // should work (currently doesn't)
Is that a reasonable thing to do/ask?
Can you provide an example where optional routes are logical? Normally, you have one route per view, say.
Why does't the last one matches anyway? sometimes the user will put a trailing / and sometimes not, and it should result in an identical route match, no?