website/src/pages/robots.txt.ts
Juan Carlos Manzanero Domínguez 53c56e05b8 fix robots file
2024-07-01 13:15:38 -06:00

17 lines
317 B
TypeScript

import type { APIRoute } from "astro";
const robotsTxt = `
User-agent: *
Allow: /
Sitemap: ${new URL("sitemap-index.xml", import.meta.env.SITE).href}
`.trim();
export const GET: APIRoute = () => {
return new Response(robotsTxt, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
},
});
};