Skip to content

Commit a288595

Browse files
committed
1
1 parent 316826b commit a288595

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ app.use(express.json());
1515
app.use(express.urlencoded({ extended: true }));
1616
app.use('/uploads', express.static('uploads'));
1717

18+
app.get('/api/health', (req, res) => {
19+
res.status(200).json({ status: 'ok', timestamp: new Date() });
20+
});
1821

1922
// 路由
2023
app.use('/api', routes);
@@ -33,9 +36,7 @@ app.use((err, req, res, next) => {
3336
});
3437
});
3538

36-
app.get('/api/health', (req, res) => {
37-
res.status(200).json({ status: 'ok', timestamp: new Date() });
38-
});
39+
3940

4041
// 启动服务器
4142
const PORT = process.env.PORT || 3000;

0 commit comments

Comments
 (0)