Files
lensflix/app/api/health/route.ts
T
2026-06-10 18:30:46 +02:00

14 lines
351 B
TypeScript

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 },
);
}