1.0.0 • Published 6 years ago
middleware-nodejs v1.0.0
Middleware for NodeJS
Zero dependencies middleware implementation. Each middleware function shall be called with any number of arguments, reference to next function shall be passed as the last argument;
Installation
npm install --save middleware-nodejs
Usage
import:
const middleware = require('middleware-js')();
pass middleware function:
middleware.use((req, res, next) => {
//...
next();
});
note that next() call is required to continue chain execution.
to kick of the chain run:
middleware.handle(req, res);
1.0.0
6 years ago