Problem
There is no narrow database-readiness probe. The existing GET /api/health aggregates DB + Redis + JWKS checks, which is heavier than what a load balancer / orchestrator wants for a simple "is the DB reachable?" liveness/readiness poll.
Proposal
Add an App Router route handler at src/app/api/health/ready/route.ts that:
- Exports an async
GET handler (Next.js 15).
- Uses the shared Prisma singleton (
import { db } from "@/lib/db").
- Pings the DB with
await db.$queryRaw\SELECT 1``.
- Returns
200 { status: "ok" } on success.
- Returns
503 { status: "error", error: <message> } on failure — never throws / 500s.
- Requires no auth/session (pollable by LBs and orchestrators).
Mirrors the checkDatabase() probe and 200/503 pattern already in src/app/api/health/route.ts.
Out of scope
- Redis / JWKS checks (covered by
/api/health).
- Auth or rate limiting.
Engine task: 768f6c2c-f880-4cbe-8fbe-bac777b60925
Problem
There is no narrow database-readiness probe. The existing
GET /api/healthaggregates DB + Redis + JWKS checks, which is heavier than what a load balancer / orchestrator wants for a simple "is the DB reachable?" liveness/readiness poll.Proposal
Add an App Router route handler at
src/app/api/health/ready/route.tsthat:GEThandler (Next.js 15).import { db } from "@/lib/db").await db.$queryRaw\SELECT 1``.200 { status: "ok" }on success.503 { status: "error", error: <message> }on failure — never throws / 500s.Mirrors the
checkDatabase()probe and 200/503 pattern already insrc/app/api/health/route.ts.Out of scope
/api/health).Engine task:
768f6c2c-f880-4cbe-8fbe-bac777b60925