connect-stack

Create a new connect middleware function from multiple other middleware functions

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(reqresnext) {
    //TODO: write auth code 
}
 
module.exports = stack(connect.cookieParser(), 
    connect.session({secret: 'hush'}),
    myAuth);
 

app.js

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