kieran / barista

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

Method in router.first function is required. This is not comfortably. #6

Closed misterjt closed 11 years ago

misterjt commented 11 years ago

You are impose to use different methods on different actions. I dont like this way. If i want to add a post to my blog i will use next way /blog?action=create Please, make method argument not required.

And one more issue. I think i found a safety hole in your router. I usualy require CSS and JS files in my HTML according to URL. So i'm making route

router.get( '/blog' )
    .to( 'blog.show',{js:["/scripts/blog.js"]})

And i get js key in object params. BUT if user make next URL /blog?js=pathToBanner.js Will i get this in params?

kieran commented 11 years ago

The router was designed for use with the standard REST actions. While you could mangle it to fit this scheme, I certainly don't recommend it!

The router is not intended to serve static assets - you should either use a static file library like node static or let nginx serve the stati assets for you.