swint-middleware

1.1.12 • Public • Published

swint-middleware

Greenkeeper badge Essential expressJS middlewares and general middleware loader for Swint

Warning: This is not the final draft yet, so do not use this until its official version is launched

Installation

$ npm install --save swint-middleware

Loader

Options

  • dir : String, default: path.dirname(require.main.filename)
  • walkOption : Object, default: { ext: 'js' }

Usage

var middlewares = loader({
	dir: path.join(__dirname, 'middlewares')
}); // { middlewareA: [Function], middlewareB: [Function], ... }

Middlewares

Usage

app.use(myMiddleware(options));
  • myMiddleware() (not myMiddleware itself) gets three arguments, which is req, res, next.

Package Sidebar

Install

npm i swint-middleware

Weekly Downloads

36

Version

1.1.12

License

MIT

Unpacked Size

22.5 kB

Total Files

22

Last publish

Collaborators

  • knowre