Files
wechatWeb/config/before_init_api.js
张成 e9fd55666f 1
2026-04-01 13:05:27 +08:00

12 lines
551 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 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 前缀各一套)`);
};