diff --git a/lib/asteroid.js b/lib/asteroid.js index e0d19243..67498417 100644 --- a/lib/asteroid.js +++ b/lib/asteroid.js @@ -63,9 +63,14 @@ for (var key in express) { * for example `asteroid.configure` etc. */ -fs.readdirSync(path.join(__dirname, 'middleware')).forEach(function (m) { - asteroid[m.replace(/\.js$/, '')] = require('./middleware/' + m); -}); +fs + .readdirSync(path.join(__dirname, 'middleware')) + .filter(function (file) { + return file.match(/\.js$/); + }) + .forEach(function (m) { + asteroid[m.replace(/\.js$/, '')] = require('./middleware/' + m); + }); /** * Error handler title