importtype { APIRoute } from'astro';
/** * robots.txt, generated from `site` in astro.config.mjs so the Sitemap line * always matches the deployed origin — nothing to keep in sync by hand. The * catalog is public reference material, so everything is crawlable. */exportconst GET:APIRoute= ({ site }) => {
const sitemap = site ?new URL('sitemap-index.xml', site).href :'/sitemap-index.xml';
const body =`User-agent: *Allow: /Sitemap: ${sitemap}`;
returnnew Response(body, {
headers: { 'Content-Type':'text/plain; charset=utf-8' },
});
};