diff --git a/teressa-copeland-homes/src/app/api/health/route.ts b/teressa-copeland-homes/src/app/api/health/route.ts new file mode 100644 index 0000000..b781ac6 --- /dev/null +++ b/teressa-copeland-homes/src/app/api/health/route.ts @@ -0,0 +1,12 @@ +import { db } from '@/lib/db'; +import { sql } from 'drizzle-orm'; + +export async function GET() { + try { + await db.execute(sql`SELECT 1`); + return Response.json({ ok: true, db: 'connected' }); + } catch (e) { + const message = e instanceof Error ? e.message : 'Unknown error'; + return Response.json({ ok: false, error: message }, { status: 503 }); + } +}