Skip to content

Commit 5171a18

Browse files
feat: Move health check endpoint to the correct position in server.js
1 parent 4bb98f0 commit 5171a18

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

backend/src/server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ if (process.env.NODE_ENV !== 'production') {
2222
);
2323
}
2424
app.use(express.json()); //This middleware will parse JSON bodies: req.body
25+
26+
app.get('/api/health', (req, res) => {
27+
res.status(200).json({ ok: true });
28+
});
29+
2530
app.use(rateLimiter);
2631

2732
app.use('/api/notes', notesRoutes);
@@ -47,7 +52,3 @@ connectDB().then(() => {
4752
console.log('Server started on PORT:', PORT);
4853
});
4954
});
50-
51-
app.get('/api/health', (req, res) => {
52-
res.status(200).json({ ok: true });
53-
});

0 commit comments

Comments
 (0)