备份:修复前完整项目快照 2026-04-19
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const express = require('express');
|
||||
const path = require('path');
|
||||
const app = express();
|
||||
const PORT = 5001;
|
||||
|
||||
// 静态文件服务
|
||||
app.use(express.static(path.join(__dirname)));
|
||||
|
||||
// 测试页面
|
||||
app.get('/test', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'test.html'));
|
||||
});
|
||||
|
||||
// 健康检查
|
||||
app.get('/health', (req, res) => {
|
||||
res.json({
|
||||
status: 'ok',
|
||||
service: 'test-server',
|
||||
timestamp: new Date().toISOString(),
|
||||
version: '1.0.0'
|
||||
});
|
||||
});
|
||||
|
||||
// 启动服务器
|
||||
app.listen(PORT, () => {
|
||||
console.log(`测试服务器运行在 http://localhost:${PORT}`);
|
||||
console.log(`测试页面: http://localhost:${PORT}/test`);
|
||||
});
|
||||
Reference in New Issue
Block a user