node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

middleware-redirect

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}"