Created
September 1, 2010 07:27
-
-
Save thejefflarson/560362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ | |
if (/\.js$/.test(filename)) { | |
var name = filename.substr(0, filename.lastIndexOf('.')); | |
Object.defineProperty(exports.middleware, name, { get: function(){ | |
return require('./middleware/' + name); | |
}}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment