SPB Git

Repository Public

route.ts 611 B 16 lines typescript

1// Vrai-Prix — méthode du coût : tableau de bord « Coût aujourd'hui » (base locale, jamais de crawl).2import { NextResponse } from "next/server";3import { buildOverview } from "@/lib/cost/catalog";4import { cached } from "@/lib/cost/cache";56export const runtime = "nodejs";78export function GET() {9  try {10    const data = cached("overview", 10 * 60_000, () => buildOverview());11    return NextResponse.json(data, { headers: { "Cache-Control": "public, max-age=300, stale-while-revalidate=600" } });12  } catch (e) {13    return NextResponse.json({ error: (e as Error).message }, { status: 500 });14  }15}16
Files main
Menu

Theme