jungles-middleware-general

Reusable route middleware for express.js

npm install jungles-middleware-general
3 downloads in the last week
16 downloads in the last month

General Middleware

General middleware written for Jungles but can be used with any Express.js app.

Render

app.get('/', render('index'));

Redirect

app.get('/', redirect('/somewhere'));

Send

Takes a function that returns the value to be send. The 'this' of the function is { req, res }.

middleware.send(function () { return this.res.locals.user; });
npm loves you