connect-stack

0.1.6 • Public • Published

connect-stack

Stack multiple connect/express middlewares into a single middleware function

example

myauth.js:

var stack = require('connect-stack'),
    connect = require('connect');
 
function myAuth(req, res, next) {
    //TODO: write auth code
}
 
module.exports = stack(connect.cookieParser(), 
    connect.session({secret: 'hush'}),
    myAuth);
 

app.js

app.use('/secret-area', require('./myauth'));

/connect-stack/

    Package Sidebar

    Install

    npm i connect-stack

    Weekly Downloads

    70

    Version

    0.1.6

    License

    MIT

    Last publish

    Collaborators

    • spion