()
| 6 | const path = require('path'); |
| 7 | |
| 8 | async function startServer() { |
| 9 | try { |
| 10 | console.log('🚀 正在启动DLMM API服务器...'); |
| 11 | console.log('📂 工作目录:', process.cwd()); |
| 12 | |
| 13 | // 动态导入编译后的JavaScript模块 |
| 14 | const { DLMMAPIServer } = await import('./dist/server/api-server.js'); |
| 15 | |
| 16 | console.log('✅ API服务器类加载成功'); |
| 17 | |
| 18 | const server = new DLMMAPIServer(7000, 7002); |
| 19 | await server.start(); |
| 20 | |
| 21 | console.log('🎉 DLMM API服务器启动成功!'); |
| 22 | console.log('🌐 API地址: http://localhost:7000'); |
| 23 | console.log('🔌 WebSocket: ws://localhost:7002'); |
| 24 | console.log('❤️ 健康检查: http://localhost:7000/api/health'); |
| 25 | |
| 26 | } catch (error) { |
| 27 | console.error('❌ 服务器启动失败:', error); |
| 28 | console.error('💡 请确保已运行 npm run build 编译TypeScript代码'); |
| 29 | process.exit(1); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // 启动服务器 |
| 34 | startServer(); |
no test coverage detected