1.0.0 • Published 6 years ago

middleware-nodejs v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

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);