Filter out non js files from middleware loader
This commit is contained in:
parent
d358ab674c
commit
dff810f31c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue