fix: 移除繁体转简体和资讯

This commit is contained in:
Daniel
2026-03-02 16:41:57 +08:00
parent ad73305ed1
commit 84656f4a11
6 changed files with 175 additions and 18 deletions

View File

@@ -7,12 +7,19 @@ const { WebSocketServer } = require('ws')
const routes = require('./routes')
const { getSituation } = require('./situationData')
const swaggerUi = require('swagger-ui-express')
const openApiSpec = require('./openapi')
const app = express()
const PORT = process.env.API_PORT || 3001
app.set('trust proxy', 1)
app.use(cors())
app.use(express.json())
// Swagger 文档
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(openApiSpec))
app.use('/api', routes)
app.get('/api/health', (_, res) => res.json({ ok: true }))
app.post('/api/crawler/notify', (_, res) => {
@@ -58,4 +65,5 @@ function notifyCrawlerUpdate() {
server.listen(PORT, () => {
console.log(`API + WebSocket running at http://localhost:${PORT}`)
console.log(`Swagger docs at http://localhost:${PORT}/api-docs`)
})