kieran / barista

A URL router / generator for NodeJS
https://kieran.github.io/barista/
MIT License
111 stars 22 forks source link

What about Strict Mode? #15

Closed misterjt closed 11 years ago

misterjt commented 11 years ago

What i gotta do if i want strict mode? I need all the urls to end with / For example /product/1/

saintc0d3r commented 11 years ago

Hi misterjt,

You could try setup your barista router to be looked like as the following:

router.get('/product/:productKey(/)') // the '(/)' at the end of the URI should do the trick for you .to('product.get');

Cheers.

kieran commented 11 years ago

This is something I'm hesitant to implement, since the trailing slash is syntactically meaningless. Though if you need it for some weird legacy reason, @saintc0d3r offers a nice simple workaround :-)

Marking as closed.