diff --git a/app/api/health/route.ts b/app/api/health/route.ts new file mode 100644 index 0000000..5f637b2 --- /dev/null +++ b/app/api/health/route.ts @@ -0,0 +1,26 @@ +import { NextResponse } from 'next/server'; + +/** + * Health check endpoint for Docker container monitoring + * Returns 200 OK with status information + */ +export async function GET() { + // Basic health check - always return healthy if the app is running + const healthData = { + status: 'healthy', + timestamp: new Date().toISOString(), + uptime: process.uptime(), + environment: process.env.NODE_ENV, + version: process.env.npm_package_version || 'unknown', + }; + + return NextResponse.json(healthData, { status: 200 }); +} + +/** + * Support HEAD requests for lightweight health checks + * Used by Docker healthcheck to minimize network traffic + */ +export async function HEAD() { + return new NextResponse(null, { status: 200 }); +}