Skip to content

Middleware to add .redirect() method to the Response object. Based on Express.

License

Notifications You must be signed in to change notification settings

thegameofcode/restify-redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restify-redirect

Middleware to add .redirect() method to the Response object. Based on Express.

res.redirect([status,] path)

Same as Express redirect method.

var restify = require('restify');
var redirect = require('restify-redirect');

var server = restify.createServer();

server.use(redirect());

server.use('/logout', function(req, res, next) {
    // do stuff here

    // redirect home
    res.redirect(302, '/');
});

About

Middleware to add .redirect() method to the Response object. Based on Express.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published