guanghulab/backend/server_副本.js
Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

39 lines
1020 B
JavaScript

require('dotenv').config();
const express = require('express');
const cors = require('cors');
const app = express();
app.use(cors());
app.use(express.json());
// 路由引入
const notionRoutes = require('./routes/notion');
const feishuRoutes = require('./routes/feishu');
const routerRoutes = require('./routes/router');
app.use('/notion', notionRoutes);
app.use('/feishu', feishuRoutes);
app.use('/router', routerRoutes);
app.get('/', (req, res) => {
res.json({
status: 'ok',
message: 'HoloLake 后端服务运行中',
version: '0.2.0',
routes: ['/notion/test', '/feishu/test', '/router/test', '/router/chat']
});
});
const PORT = process.env.PORT || 3000;
// 飞书 Webhook 处理
app.post('/webhook/feishu', (req, res) => {
console.log('收到飞书请求:', req.body);
if (req.body.challenge) {
return res.json({ challenge: req.body.challenge });
}
res.json({ message: 'received' });
});
app.listen(PORT, () => {
console.log(`🚀 服务启动成功,端口:${PORT}`);
});