-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathstart-api.js
More file actions
34 lines (26 loc) · 1.03 KB
/
Copy pathstart-api.js
File metadata and controls
34 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* DLMM API服务器启动脚本
* 使用编译后的JavaScript文件启动
*/
const path = require('path');
async function startServer() {
try {
console.log('🚀 正在启动DLMM API服务器...');
console.log('📂 工作目录:', process.cwd());
// 动态导入编译后的JavaScript模块
const { DLMMAPIServer } = await import('./dist/server/api-server.js');
console.log('✅ API服务器类加载成功');
const server = new DLMMAPIServer(7000, 7002);
await server.start();
console.log('🎉 DLMM API服务器启动成功!');
console.log('🌐 API地址: http://localhost:7000');
console.log('🔌 WebSocket: ws://localhost:7002');
console.log('❤️ 健康检查: http://localhost:7000/api/health');
} catch (error) {
console.error('❌ 服务器启动失败:', error);
console.error('💡 请确保已运行 npm run build 编译TypeScript代码');
process.exit(1);
}
}
// 启动服务器
startServer();