// app/sitemap/route.ts interface SitemapPage { loc: string; lastmod: string; } export const GET = async () => { const BASE_URL = "https://trees.falktron.com"; const useCases = [ "forestry", "research", "agriculture", "cities-communities", ]; const pages: SitemapPage[] = [ { loc: `${BASE_URL}/`, lastmod: new Date().toISOString().split("T")[0] }, ...useCases.map((slug) => ({ loc: `${BASE_URL}/use-cases/${slug}`, lastmod: new Date().toISOString().split("T")[0], })), ]; const xml = ` ${pages .map( (page) => ` ${page.loc} ${page.lastmod} ` ) .join("")} `; return new Response(xml, { status: 200, headers: { "Content-Type": "application/xml", "Cache-Control": "public, s-maxage=86400, stale-while-revalidate=3600", }, }); };