feat(core): first attempt to init script standard (#8224)

- lazy load
- rate limit per path
- init .debug.json support
- docs
- maintainer
- radar
This commit is contained in:
NeverBehave
2021-09-22 05:41:00 -07:00
committed by GitHub
parent d77a039f05
commit 0792f7ba25
51 changed files with 737 additions and 331 deletions

17
lib/v2router.js Normal file
View File

@@ -0,0 +1,17 @@
const dirname = __dirname + '/v2';
// 遍历整个 routes 文件夹,收集模块路由 router.js
const RouterPath = require('require-all')({
dirname,
filter: /router\.js$/,
});
const routes = {};
// 将收集到的自定义模块路由进行合并
for (const dir in RouterPath) {
const project = RouterPath[dir]['router.js']; // Do not merge other file
routes[dir] = project;
}
module.exports = routes;