first commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { checkDbConnection } from "@/lib/db";
|
||||
|
||||
export async function GET() {
|
||||
const dbHealthy = await checkDbConnection();
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
status: dbHealthy ? "ok" : "degraded",
|
||||
db: dbHealthy ? "connected" : "unavailable",
|
||||
},
|
||||
{ status: dbHealthy ? 200 : 503 },
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user