import { NextResponse } from "next/server"; import { fetchOpsHealth } from "@/lib/admin/ops-health"; import { withAdmin } from "@/lib/api-handler"; import { PERMS } from "@/lib/permissions"; export const GET = withAdmin({ permission: PERMS.DEVOPS_VIEW }, async () => { const health = await fetchOpsHealth(); return NextResponse.json({ database: health.dbOk, dbLatency: health.dbLatencyMs, emulator: health.emulatorOk, onlineUsers: health.onlineUsers, timestamp: new Date().toISOString(), }); });