import { formatMetrics } from "@/lib/token/metrics";

/**
 * GET /api/token/metrics — Prometheus-compatible metrics endpoint for Token.
 *
 * No auth required (standard for Prometheus scrape targets).
 * Returns text/plain in Prometheus exposition format.
 */
export async function GET() {
  const body = formatMetrics();
  return new Response(body, {
    status: 200,
    headers: {
      "Content-Type": "text/plain; version=0.0.4; charset=utf-8",
      "Cache-Control": "no-cache, no-store, must-revalidate",
    },
  });
}
