Skip to content

Zero dependencies middleware pattern implementation

Notifications You must be signed in to change notification settings

tatiananeda/middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Zero dependencies middleware pattern implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published