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

View File

@@ -1,15 +1,13 @@
const Router = require('@koa/router');
const router = new Router();
const routes = require('./router');
const maintainer = require('./maintainer');
router.get('/routes/:name?', (ctx) => {
const allRoutes = Array.from(routes.stack);
allRoutes.shift();
const result = {};
let counter = 0;
allRoutes.forEach((i) => {
const path = i.path;
Object.keys(maintainer).forEach((i) => {
const path = i;
const top = path.split('/')[1];
if (!ctx.params.name || top === ctx.params.name) {