消毒机设备
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.

24 lines
649 B

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