返回 CodeWhale
route.ts
根目录 / web / app / api / releases / route.ts
1 import { NextResponse } from "next/server";
2 import { getFacts } from "@/lib/facts";
3 import { getReleaseUpdates } from "@/lib/release-updates";
4
5 export const dynamic = "force-dynamic";
6
7 export async function GET() {
8 const facts = await getFacts();
9 const snapshot = await getReleaseUpdates(facts.latestPublishedRelease);
10 return NextResponse.json(snapshot, {
11 headers: { "Cache-Control": "public, max-age=0, must-revalidate" },
12 });
13 }
14
14 lines TYPESCRIPT