From 8d0a5f3faf488dc76eae5f61bed4afdc7fc63122 Mon Sep 17 00:00:00 2001 From: Christian Landgren Date: Wed, 12 Jun 2024 11:32:22 +0200 Subject: [PATCH] fix: health route for automatic restart of server --- api/server.ts | 1 + k8s/api.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/server.ts b/api/server.ts index b7a45ec..0fcecda 100644 --- a/api/server.ts +++ b/api/server.ts @@ -22,6 +22,7 @@ const io = new Server(server, { }) app.use('/assets', express.static(path.join(__dirname, '../assets'))) +app.get('/healthz', (req, res) => res.send('ok')) server.listen(port, () => { console.log(`listening on *:${port}`) diff --git a/k8s/api.yaml b/k8s/api.yaml index 19347fe..18150e8 100644 --- a/k8s/api.yaml +++ b/k8s/api.yaml @@ -26,13 +26,13 @@ spec: name: http readinessProbe: httpGet: - path: / + path: /socket.io/socket.io.js port: http initialDelaySeconds: 5 periodSeconds: 10 livenessProbe: httpGet: - path: / + path: /socket.io/socket.io.js port: http initialDelaySeconds: 30 periodSeconds: 60