manually load middleware

This commit is contained in:
b1ek 2023-02-25 16:33:13 +10:00
parent 15d229704e
commit 6af483ece5
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 3 additions and 13 deletions

View File

@ -2,18 +2,7 @@ const express = require('express');
const router = express.Router(); const router = express.Router();
const glob = require('glob'); const glob = require('glob');
glob(__dirname + "/**/*.js", {}, (er, data) => { router.use(require('./session'));
if (er) { router.use(require('./session_back'));
console.error(er);
process.exit(-1);
}
data
.filter(file => {
return !file.endsWith('index.js')
})
.forEach(file => {
require(file)(router);
});
});
module.exports = router; module.exports = router;

1
middleware/session.js Normal file
View File

@ -0,0 +1 @@
module.exports = (router) => {}