kieran / barista

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

Add request header routing #13

Open techwraith opened 11 years ago

techwraith commented 11 years ago

It would be great if Barista allowed us to match routes based on the request's headers. It would help a lot when allowing custom domain support.

router.match('/').where({headers: {host: 'somesite.com'}})
kieran commented 11 years ago

While Barista has no knowledge of the request itself (nor do I think it should, separation of concerns etc...), I could certainly hack in a way of matching arbitrary params, then Geddy would pass in a hash of whatever as a third parameter for matching.

techwraith commented 11 years ago

That would work for our use case :)