homepage.js/routes/index.js

19 lines
417 B
JavaScript
Raw Permalink Normal View History

2023-02-13 02:16:46 +01:00
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);
});
});
module.exports = router;