This commit is contained in:
张成
2026-04-01 13:05:27 +08:00
parent 6f61287c70
commit e9fd55666f
18 changed files with 9301 additions and 251 deletions

11
config/before_init_api.js Normal file
View File

@@ -0,0 +1,11 @@
/**
* Framework.init 的 beforeInitApi在 _setupRoutes 之前注册手动路由(规范见 .cursor/rules/node-core-framework.mdc
*/
module.exports = async function beforeInitApi(framework) {
const { buildProxyRoutes } = require("../api/controller_custom/proxy_api");
const proxy_routes = buildProxyRoutes();
const n = Object.keys(proxy_routes).length;
framework.addRoutes("", proxy_routes);
framework.addRoutes("/api", proxy_routes);
console.log(`📡 已注册 ${n} 个转发接口(文档路径 + /api 前缀各一套)`);
};