Skip to content

Commit 1b2436e

Browse files
feat: Add health check endpoint and GitHub Actions workflow for deployment monitoring
1 parent b947c9f commit 1b2436e

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/healthcheck.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Render Health Check
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
workflow_dispatch:
7+
8+
jobs:
9+
healthcheck:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Wait for Render deploy
13+
run: sleep 25
14+
15+
- name: Health check
16+
run: |
17+
set -e
18+
curl -fsS "$RENDER_HEALTH_URL"

backend/src/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ connectDB().then(() => {
4747
console.log('Server started on PORT:', PORT);
4848
});
4949
});
50+
51+
app.get('/api/health', (req, res) => {
52+
res.status(200).json({ ok: true });
53+
});

0 commit comments

Comments
 (0)