mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-04 02:58:08 +08:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user