import type {APIRoute} from 'astro'; import {siteConfig} from "@/consts"; const site = siteConfig.site const staticUrls = [ '', '/archive' ]; export const GET: APIRoute = async () => { const urls = staticUrls .filter((url, index, array) => { return array.indexOf(url) === index; }); const xml = ` ${urls.map((url) => ` ${site}${url} ` ) .join('\n')} `; return new Response(xml, { status: 200, headers: { 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, max-age=3600, s-maxage=3600', }, }); };