You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
461 B

  1. // const express = require('express')
  2. import express from 'express'
  3. import { debugRoutes } from './routes/debug.js'
  4. import { initWebSocketServer } from './utils/websocket.js'
  5. const app = express()
  6. const PORT = 8080 // 可根据需要更改端口号
  7. app.listen(PORT, () => {
  8. console.log(`服务器已启动,正在监听端口 ${PORT}`)
  9. })
  10. app.use(express.json())
  11. // 初始化 WebSocket 服务
  12. initWebSocketServer()
  13. // 注册路由模块
  14. debugRoutes(app)