Add SQLite connectivity check to healthcheck endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 14:59:52 -05:00
co-authored by Claude Opus 4.6
parent 3455ff9c51
commit 18385386d5
+9 -2
View File
@@ -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 });
}
}