From 428ab82c6933f2e4ec0060acea460f0fcf32bae9 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Wed, 15 Apr 2026 14:52:28 -0500 Subject: [PATCH 1/2] Add simple healthcheck endpoint --- src/hooks.server.ts | 1 + src/routes/(api)/health/+server.ts | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 src/routes/(api)/health/+server.ts diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 3d65a10..466fd73 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -10,6 +10,7 @@ import { allWorkers } from '$lib/server/bullmq/BullMQ'; import { DatabaseConnected } from '$lib/server/prisma'; const handleAPIRoute: Handle = async ({ event, resolve }) => { + if (event.route.id?.split('/')?.[2] === 'health') return resolve(event); const [success, res] = await tryVerifyAPIToken(event); if (!success) { return res; diff --git a/src/routes/(api)/health/+server.ts b/src/routes/(api)/health/+server.ts new file mode 100644 index 0000000..fd5abbc --- /dev/null +++ b/src/routes/(api)/health/+server.ts @@ -0,0 +1,6 @@ +import type { RequestHandler } from './$types'; + +// GET health +export const GET: RequestHandler = async () => { + return new Response(null, { status: 200 }); +}; From 1f776753eb763fa266ed1d7fd5964fce37332551 Mon Sep 17 00:00:00 2001 From: Aidan Jones Date: Wed, 15 Apr 2026 14:59:16 -0500 Subject: [PATCH 2/2] CR feedback --- src/hooks.server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 466fd73..8114cd8 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -10,7 +10,7 @@ import { allWorkers } from '$lib/server/bullmq/BullMQ'; import { DatabaseConnected } from '$lib/server/prisma'; const handleAPIRoute: Handle = async ({ event, resolve }) => { - if (event.route.id?.split('/')?.[2] === 'health') return resolve(event); + if (event.route.id === '/(api)/health') return resolve(event); const [success, res] = await tryVerifyAPIToken(event); if (!success) { return res;