Initial commit from template
This commit is contained in:
27
app/api/health/route.ts
Normal file
27
app/api/health/route.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user