CamShaft/startup — pull request #7 by timshadel (2013-04-18 22:17:42+00:00)
Title: Grab each middleware's config options to display.

Very minimal alteration to your middleware declaration. Intead of this:

module.exports = function(config) {
return function myMiddleware() ...

You simply do this:

var defaults = {
myItem: 42 // defaults to the answer
}

module.exports = function(config) {
function myMiddleware() {
config = config || {};
config.myItem = config.myItem || defaults.myItem.slice();
...
}

myMiddleware.config = config;
return myMiddleware;
}

It just happens to match up exactly with `connect-xcors`.

See https://github.com/antono/connect-cors/blob/master/lib/connect-cors.js#L58-L63