Compose an array of middleware into a single function for use in Express, Connect, router, etc.
npm install compose-middleware --save
Compose multiple middleware functions into a single request middleware handler, with support for inline error handling middleware.
var express =var compose = composevar app =app
P.S. The composed function takes three arguments. Express.js (and Connect, router) only accept error handlers of four arguments. If you want to return an error handler from
compose instead, try the
errors export - it works exactly the same, but exposes the four argument middleware pattern.