Files
lumina-nextjs-template/app/api/health/route.ts
2025-12-23 04:19:57 +01:00

28 lines
700 B
TypeScript

/**
* Health Check Endpoint
* Used by Kubernetes liveness and readiness probes
*/
export async function GET() {
try {
// Basic health check - returns 200 if app is running
const healthData = {
status: 'healthy',
timestamp: new Date().toISOString(),
uptime: process.uptime(),
environment: process.env.NODE_ENV || 'development',
};
return Response.json(healthData, { status: 200 });
} catch (error) {
return Response.json(
{
status: 'unhealthy',
error: error instanceof Error ? error.message : 'Unknown error',
timestamp: new Date().toISOString(),
},
{ status: 503 }
);
}
}