Add developer API, Prometheus metrics, and community links

This commit is contained in:
2026-10-12 19:59:37 +05:00
parent 3cc3136762
commit 018be5049e
50 changed files with 4087 additions and 31 deletions

16
app/api/metrics/route.ts Normal file
View File

@@ -0,0 +1,16 @@
import { admin, required } from "@/lib/supabase";
import { metricsResponse } from "@/lib/prometheus-response";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export const maxDuration = 30;
export function GET(request: Request) {
return metricsResponse(request, async (tokenHash) => {
const result = await admin().rpc("read_prometheus_metrics", {
p_token_hash: tokenHash,
});
// NULL is an invalid or disabled credential, not a missing database record.
if (result.error) required(result);
return result.data;
});
}