middleware-redirect

npm install middleware-redirect
2 downloads in the last month

middleware-redirect

node middleware that handles redirection.

Usage

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}"
npm loves you