diff --git a/packages/linea-ccip-gateway/package.json b/packages/linea-ccip-gateway/package.json index 69762984e..75a582305 100644 --- a/packages/linea-ccip-gateway/package.json +++ b/packages/linea-ccip-gateway/package.json @@ -1,6 +1,6 @@ { "name": "@consensys/linea-ccip-gateway", - "version": "1.0.1", + "version": "1.1.0", "main": "dist/index.js", "author": "Consensys", "license": "Apache-2.0", @@ -53,4 +53,4 @@ "@types/supertest": "^2.0.14", "nyc": "^15.1.0" } -} \ No newline at end of file +} diff --git a/packages/linea-ccip-gateway/src/server.ts b/packages/linea-ccip-gateway/src/server.ts index 6e3f39087..526d9c483 100644 --- a/packages/linea-ccip-gateway/src/server.ts +++ b/packages/linea-ccip-gateway/src/server.ts @@ -28,12 +28,20 @@ try { console.log("Server setup complete."); - // Add a health check page - app.get("/health", async (_req, res, _next) => { - const healthcheck = { + // Liveness probe + app.get("/live", async (_req, res, _next) => { + res.send({ uptime: process.uptime(), message: "OK", timestamp: Date.now(), + }); + }); + + // Readiness probe + app.get("/ready", async (_req, res, _next) => { + const readiness = { + message: "OK", + timestamp: Date.now(), }; try { const host = _req.protocol + "://" + _req.get("host"); @@ -47,15 +55,15 @@ try { } const check = await fetch(urlToCheck); if (check.status != 200) { - healthcheck.message = check.statusText; - logError(healthcheck); + readiness.message = check.statusText; + logError(readiness); res.status(check.status).send(); } else { - res.send(healthcheck); + res.send(readiness); } } catch (error) { - healthcheck.message = error; - logError(error, healthcheck); + readiness.message = error; + logError(error, readiness); res.status(500).send(); } });