mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 02:11:35 +01:00
13 lines
306 B
TypeScript
13 lines
306 B
TypeScript
import type { APIRoute } from "astro";
|
|
|
|
const getRobotsTxt = (sitemapURL: URL) => `User-agent: *
|
|
Allow: /
|
|
|
|
Sitemap: ${sitemapURL.href}
|
|
`;
|
|
|
|
export const GET: APIRoute = (context) => {
|
|
const sitemapURL = new URL("sitemap-index.xml", context.url.origin);
|
|
return new Response(getRobotsTxt(sitemapURL));
|
|
};
|