From b2641482e3cd165eadf8a061d6e242c8d816762b Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Fri, 15 Dec 2023 18:26:14 -0800 Subject: [PATCH] server lite handle start-up --- src/serverLite.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/serverLite.ts b/src/serverLite.ts index 4a0a062..abcd771 100644 --- a/src/serverLite.ts +++ b/src/serverLite.ts @@ -153,6 +153,17 @@ const main = async () => { handleHealthCheck(2 * SLOT_STALENESS_TOLERANCE * 400, slotSubscriber) ); + const handleStartup = async (_req, res, _next) => { + if (redisClient.connected) { + res.writeHead(200); + res.end('OK'); + } else { + res.writeHead(500); + res.end('Not ready'); + } + }; + app.get('/startup', handleStartup); + app.get('/l2', async (req, res, next) => { try { const {