first build commit
This commit is contained in:
11
src/app/api/health/route.ts
Normal file
11
src/app/api/health/route.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
await prisma.$queryRaw`SELECT 1`
|
||||
return NextResponse.json({ status: 'ok' })
|
||||
} catch {
|
||||
return NextResponse.json({ status: 'error', detail: 'database unreachable' }, { status: 503 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user