Files
Fuwari-Blog/src/pages/robots.txt.ts
2025-08-24 06:03:55 +08:00

17 lines
318 B
TypeScript

import type { APIRoute } from "astro";
const robotsTxt = `
User-agent: *
Disallow: /_astro/
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",
},
});
};