javascript-route-matcher icon indicating copy to clipboard operation
javascript-route-matcher copied to clipboard

optional extra route?

Open yairEO opened this issue 10 years ago • 2 comments

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?

yairEO avatar Oct 18 '15 15:10 yairEO

Can you provide an example where optional routes are logical? Normally, you have one route per view, say.

japborst avatar Oct 31 '15 21:10 japborst

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?

yairEO avatar Nov 05 '15 22:11 yairEO