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

37 lines
1.1 KiB
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.
/**
* 后端应用入口 — node-core-framework约定见 .cursor/rules/node-core-framework.mdc
*/
const Framework = require("./framework/node-core-framework.js");
const config = require("./config/framework.config.js");
const businessAssociations = require("./config/model.associations.js");
async function start() {
try {
console.log("🚀 正在启动应用...\n");
console.log("⚙️ 正在初始化框架...");
const framework = await Framework.init({
...config,
businessAssociations,
});
await framework.start(config.port.node);
const schedule = require("./middleware/schedule.js");
await schedule.init();
console.log(`\n📚 API 文档: http://localhost:${config.port.node}/api/docs`);
} catch (error) {
console.error("\n" + "=".repeat(60));
console.error("❌ 应用启动失败!");
console.error("=".repeat(60));
console.error("错误信息:", error.message);
console.error("错误堆栈:", error.stack);
console.error("=".repeat(60) + "\n");
process.exit(1);
}
}
start();