yahoo/mojito — pull request #661 by rodnic (2012-10-24 02:35:28+00:00)
Title: Configuration for user-provided middlewares

Now the developer can load custom middlewares from a folder. If options.midDir is empty, the folder ./middleware is assumed to be the default location to store custom middlewares. This new configuration is useful for middlewares that need to be loaded before the server starts.

Example of configuration:

#server.js

options.midDir = 'middleware';
// options.midDir = './custom-scripts/middleware'; works too

// Some middlewares
options.appConfig = {
middleware: [
'middleware-passport-init',
'middleware-passport-session',
'middleware-facebook-auth'
]
};

var app = Mojito.createServer(options);