import { SITE_URL } from "@/lib/routes"; import { sitemapIds } from "./ids"; /** Sitemap index (robots.txt points here) listing every per-id sitemap generated by app/sitemap.ts. */ export const revalidate = 3600; export function GET(): Response { const now = new Date().toISOString(); const body = ` ${sitemapIds() .map((id) => ` ${SITE_URL}/sitemap/${id}.xml${now}`) .join("\n")} `; return new Response(body, { headers: { "Content-Type": "application/xml; charset=utf-8", "Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400" } }); }