middleware-redirect

middleware-redirect ===================

middleware-redirect

node middleware that handles redirection.

redirect = require 'middleware-redirect'
 
# redirects `/foo` to `/bar` 
router.get '/foo',
    redirect '/bar'
 
# redirects `/foo/$var` to `/bar/$var` 
router.get '/foo/:id',
    redirect (req) -> "/bar/#{req.params.id}"