diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-11-01 12:44:20 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-11-01 12:44:20 -0700 |
| commit | 4618980eb59e0f591cf23fd7b33a52cc799fbf03 (patch) | |
| tree | 8f3bc6f1c8bad419dae5ef892a00bee80344c9f9 /gateway/src/server.js | |
| parent | 5d4703302167fe2f06c2fcbc2d2a5d1d247c7ca0 (diff) | |
fix 1
Diffstat (limited to 'gateway/src/server.js')
| -rw-r--r-- | gateway/src/server.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gateway/src/server.js b/gateway/src/server.js index b4e716e..eb01c8c 100644 --- a/gateway/src/server.js +++ b/gateway/src/server.js @@ -7,6 +7,7 @@ import { VoiceSession } from "./voice-session.js"; const VOICE_PATH = "/ws/voice"; const STATUS_PATH = "/voice-gateway/status"; +const HEALTH_PATH = "/healthz"; const HEARTBEAT_MS = 30_000; const HOP_BY_HOP = ["connection", "keep-alive", "proxy-connection", "proxy-authenticate", "proxy-authorization", "te", "trailer", "upgrade"]; @@ -61,6 +62,13 @@ export function createGatewayServer(config, log = console) { } const server = http.createServer((req, res) => { + // Docker HEALTHCHECK target: answered by the gateway itself so it does not + // depend on (or 404 from) the Flask dashboard behind it. + if (req.url === HEALTH_PATH) { + res.writeHead(200, { "content-type": "text/plain; charset=utf-8", "cache-control": "no-store" }); + res.end("ok"); + return; + } if (req.url === STATUS_PATH) { res.writeHead(200, { "content-type": "application/json", "cache-control": "no-store" }); res.end(JSON.stringify({ available: voiceAvailable(), sessions: sessions.size, maxSessions: config.voice.maxSessions })); |
