From 3c49365c12f1ab0dc96b8e1b948159596540dd47 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Fri, 22 May 2026 13:42:59 +0000 Subject: [PATCH] fix(GRO-1544): register health endpoint at /api/health on app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrected: use app.get("/api/health", ...) instead of api.get("/health", ...). api is not declared until ~130 lines later — const has no hoisting, causing TDZ ReferenceError at startup. Health endpoint registered on app at full path /api/health, before any auth middleware, so it's reachable from outside the cluster. Co-Authored-By: Claude Opus 4.7 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 90c962d..9ae50b8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,8 +58,8 @@ app.use( }) ); -// Health check — registered on api before auth middleware so it is reachable at /api/health -api.get("/health", (c) => c.json({ status: "ok" })); +// Health check — no auth required, registered on app at full path before auth middleware +app.get("/api/health", (c) => c.json({ status: "ok" })); // Public booking routes — no auth required, must be registered before auth middleware app.route("/api/book", bookRouter);