page.tsx19 lines · main
1import { apiJson } from '@/lib/api';
2import { apiOrigin } from '@/lib/env';
3
4import { HealthBoard, type HealthSummary } from './health-client';
5
6export const metadata = { title: 'platform health · admin' };
7export const dynamic = 'force-dynamic';
8
9/**
10 * Platform health — thin server shell. Fetches the first health summary
11 * server-side (instant paint, cookies forwarded by apiFetch) and hands off
12 * to the client board, which keeps it genuinely live by re-polling
13 * /v1/admin/health every 10s with credentials — the same api-origin
14 * pattern the mcp page's client controls use.
15 */
16export default async function AdminHealthPage() {
17 const initial = await apiJson<HealthSummary>('/v1/admin/health').catch(() => null);
18 return <HealthBoard apiOrigin={apiOrigin} initial={initial} />;
19}