Fix build issues and add health endpoint

This commit is contained in:
Alexa Amundson
2025-11-22 00:29:33 -06:00
parent 80581804dc
commit e34cda9fe9
3 changed files with 9 additions and 18 deletions

View File

@@ -1,20 +1,8 @@
import { NextResponse } from 'next/server';
import { pollServiceHealth, serverConfig } from '@/lib/config';
import { SERVICE_ID } from '@/config/serviceConfig';
export async function GET() {
const services = await pollServiceHealth();
const healthy = services.every((service) => service.status === 'healthy' || service.status === 'not_configured');
const payload = {
return NextResponse.json({
status: 'ok',
service: 'prism-console',
ok: healthy,
ts: new Date().toISOString(),
environment: serverConfig.environment,
version: process.env.npm_package_version ?? 'unknown',
services
};
return NextResponse.json(payload, { status: healthy ? 200 : 503 });
service: 'prism-console'
});
}