Files
edueasy/app/api/health/route.ts
T
renato97 411f235f75 feat: fase 5 — botones volver, seguridad APIs, infraestructura
- Botón 'Volver' en todas las sesiones de ejercicios (ExerciseSession)
- Botón 'Cambiar perfil' en las 3 home pages (Isabella/Francesca/Sebastián)
- Páginas inline de Isabella migradas a ExerciseSession (elimina código duplicado)
- APIs con try/catch: curriculum/next, dashboard/summary, fsrs/next, children
- Validación childId en curriculum/next (404 si no existe)
- /api/health endpoint para Docker healthcheck
- .env.example, .dockerignore, README.md creados
- docker-compose.yml con healthcheck en app service
- Test E2E: health endpoint + childId validation
- 62/62 tests pasan, TS exit 0
2026-07-26 02:00:27 -03:00

19 lines
422 B
TypeScript

import { NextResponse } from "next/server"
import { prisma } from "@/lib/db"
export async function GET() {
try {
await prisma.$queryRaw`SELECT 1`
return NextResponse.json({
status: "ok",
timestamp: Date.now(),
database: "connected",
})
} catch {
return NextResponse.json(
{ status: "error", timestamp: Date.now(), database: "disconnected" },
{ status: 503 },
)
}
}