cshenfu
2024-05-21 09d8c671d5e6e6045677bfb5218a5fb78c26aa0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 加载模块 - 中间件 请勿改动此文件-----------------------------------
const modulesPath = __dirname+"/modules";
const fs = require('fs');
const fileList = fs.readdirSync(modulesPath);
var moduleList = [];
var modulesNames = [];
 
fileList.map((file, index) => {
    if(file.indexOf(".js") > -1){
        modulesNames.push(file.substring(0,file.length-3));
    }
});
 
modulesNames.map((modulesName, index) => {
    moduleList.push(require(modulesPath+"/"+modulesName));
});
 
var middlewareList = [];
moduleList.map((moduleItem, index) => {
    middlewareList = middlewareList.concat(moduleItem);
});
module.exports = middlewareList;
// 加载模块 - 中间件 请勿改动此文件-----------------------------------