manually load middleware
This commit is contained in:
parent
15d229704e
commit
6af483ece5
|
@ -2,18 +2,7 @@ const express = require('express');
|
|||
const router = express.Router();
|
||||
const glob = require('glob');
|
||||
|
||||
glob(__dirname + "/**/*.js", {}, (er, data) => {
|
||||
if (er) {
|
||||
console.error(er);
|
||||
process.exit(-1);
|
||||
}
|
||||
data
|
||||
.filter(file => {
|
||||
return !file.endsWith('index.js')
|
||||
})
|
||||
.forEach(file => {
|
||||
require(file)(router);
|
||||
});
|
||||
});
|
||||
router.use(require('./session'));
|
||||
router.use(require('./session_back'));
|
||||
|
||||
module.exports = router;
|
|
@ -0,0 +1 @@
|
|||
module.exports = (router) => {}
|
Loading…
Reference in New Issue