mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 22:19:40 +08:00
feat: add EpicGames get FreeGames (#3196)
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
const Router = require('koa-router');
|
||||
const router = new Router();
|
||||
|
||||
// 遍历整个 routes 文件夹,导入模块路由 router.js 和 router-custom.js 文件
|
||||
// 格式参考用例:routes/epicgames/router.js
|
||||
const RouterPath = require('require-all')({
|
||||
dirname: __dirname + '/routes',
|
||||
filter: /^.*router([-_]custom[s]?)?\.js$/,
|
||||
});
|
||||
|
||||
// 将收集到的自定义模块路由进行合并
|
||||
for (const project in RouterPath) {
|
||||
for (const routerName in RouterPath[project]) {
|
||||
const proRouter = RouterPath[project][routerName]();
|
||||
proRouter.stack.forEach((nestedLayer) => {
|
||||
router.stack.push(nestedLayer);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// index
|
||||
router.get('/', require('./routes/index'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user