middleware-responder
A node.js middleware for setting render and redirect options on the req object. Specifically req.render
and req.redirect
.
To install:
npm install middleware-responder --save
Example usage:
routes.js
var setRedirect = setRedirect;var setRender = setRender; app; app;
user-controller.js
exports{ // app logic here res; // 'home'}; exports{ // login logic here ifrequser return res; // redirects to 'dashboard'; res; // redirect to '/'};