/** * llmindex.io — GET /api/v1/health * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * License: Proprietary — © Simon-Pierre Boucher, all rights reserved */ import { prisma } from '@llmindex/db'; import { INDEX_VERSION } from '@llmindex/scoring'; import { apiJson } from '@/lib/api'; export const dynamic = 'force-dynamic'; export async function GET() { let db = false; try { await prisma.$queryRaw`SELECT 1`; db = true; } catch { db = false; } return apiJson( { status: db ? 'ok' : 'degraded', db, index_version: INDEX_VERSION }, { status: db ? 200 : 503 }, ); }