1
This commit is contained in:
7
app.js
7
app.js
@@ -18,11 +18,16 @@ async function start() {
|
||||
console.log('⚙️ 正在初始化框架...');
|
||||
|
||||
|
||||
const { buildProxyRoutes } = require('./api/controller_custom/proxy_api');
|
||||
|
||||
const framework = await Framework.init({
|
||||
...config,
|
||||
businessAssociations,
|
||||
beforeInitApi: async (framework) => {
|
||||
|
||||
// 从 swagger.json 动态注册 193 个转发路由到 /api 前缀
|
||||
const proxyRoutes = buildProxyRoutes();
|
||||
framework.addRoutes('/api', proxyRoutes);
|
||||
console.log(`📡 已注册 ${Object.keys(proxyRoutes).length} 个 API 转发路由`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user