Files
Epicnabbo-Catalogus-Updated…/src/app/api/admin/devops/health/route.ts
T

18 lines
536 B
TypeScript

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,
redis: health.redisOk,
emulator: health.emulatorOk,
onlineUsers: health.onlineUsers,
timestamp: new Date().toISOString(),
});
});