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.

20 lines
523 B

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