From 541728805f2b5c894dfe4e176321ea181ddc7d24 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 6 Oct 2024 02:46:07 -0600 Subject: [PATCH] refactor: add health path to middleware --- apps/api/src/index.ts | 3 +++ apps/schedules/src/index.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 0bcf4ca68..bf91b0400 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -14,6 +14,9 @@ const redisClient = createClient({ }); app.use(async (c, next) => { + if (c.req.path === "/health") { + return next(); + } const authHeader = c.req.header("X-API-Key"); if (process.env.API_KEY !== authHeader) { diff --git a/apps/schedules/src/index.ts b/apps/schedules/src/index.ts index 1866a1f28..4fd7f58b3 100644 --- a/apps/schedules/src/index.ts +++ b/apps/schedules/src/index.ts @@ -12,6 +12,9 @@ const app = new Hono(); cleanQueue(); app.use(async (c, next) => { + if (c.req.path === "/health") { + return next(); + } const authHeader = c.req.header("X-API-Key"); if (process.env.API_KEY !== authHeader) {