mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 06:15:39 -04:00
Add SQLite connectivity check to healthcheck endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user