diff --git a/nodejs/server.js b/nodejs/server.js index 5638915..4bfbb02 100644 --- a/nodejs/server.js +++ b/nodejs/server.js @@ -34,6 +34,16 @@ app.post('/emit', (req, res) => { 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 ───────────────────────────────────────────────────── // Each browser tab connects here on page load. // It joins a room named company_ so events stay isolated per company.