Add health endpoints, agents wiring, and deployment updates
This commit is contained in:
17
src/app/api/health/route.ts
Normal file
17
src/app/api/health/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { pollServiceHealth, serverConfig } from '@/lib/config';
|
||||
|
||||
export async function GET() {
|
||||
const services = await pollServiceHealth();
|
||||
const healthy = services.every((service) => service.status === 'healthy' || service.status === 'not_configured');
|
||||
|
||||
const payload = {
|
||||
status: healthy ? 'ok' : 'degraded',
|
||||
timestamp: new Date().toISOString(),
|
||||
environment: serverConfig.environment,
|
||||
version: process.env.npm_package_version ?? 'unknown',
|
||||
services
|
||||
};
|
||||
|
||||
return NextResponse.json(payload, { status: healthy ? 200 : 503 });
|
||||
}
|
||||
Reference in New Issue
Block a user