nodejs status check
This commit is contained in:
@@ -34,6 +34,16 @@ app.post('/emit', (req, res) => {
|
|||||||
res.json({ ok: true });
|
res.json({ ok: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ── /health ───────────────────────────────────────────────────────────────────
|
||||||
|
app.get('/health', (req, res) => {
|
||||||
|
res.json({
|
||||||
|
status: 'ok',
|
||||||
|
uptime: Math.floor(process.uptime()),
|
||||||
|
connections: io.engine.clientsCount,
|
||||||
|
memory_mb: Math.round(process.memoryUsage().rss / 1024 / 1024 * 10) / 10
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// ── WebSocket connections ─────────────────────────────────────────────────────
|
// ── WebSocket connections ─────────────────────────────────────────────────────
|
||||||
// Each browser tab connects here on page load.
|
// Each browser tab connects here on page load.
|
||||||
// It joins a room named company_<id> so events stay isolated per company.
|
// It joins a room named company_<id> so events stay isolated per company.
|
||||||
|
|||||||
Reference in New Issue
Block a user