From 18385386d57fef138a380988e9b8ef5310f69e41 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 2 Mar 2026 14:59:52 -0500 Subject: [PATCH] Add SQLite connectivity check to healthcheck endpoint Co-Authored-By: Claude Opus 4.6 --- app/api/health/route.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/api/health/route.ts b/app/api/health/route.ts index f7d3295..3c9057f 100644 --- a/app/api/health/route.ts +++ b/app/api/health/route.ts @@ -1,5 +1,12 @@ import { NextResponse } from "next/server"; +import { client } from "@/lib/db/client"; -export function GET() { - return NextResponse.json({ status: "ok" }); +export async function GET() { + try { + await client.execute("SELECT 1"); + + return NextResponse.json({ status: "healthy" }, { status: 200 }); + } catch { + return NextResponse.json({ status: "unhealthy" }, { status: 503 }); + } }