[READ-ONLY] Mirror of https://github.com/mrgnw/morganwill.com. morganwill.com
0

Configure Feed

Select the types of activity you want to include in your feed.

morganwill.com / src / routes / robots.txt / +server.ts
522 B 22 lines
1import type { RequestHandler } from "@sveltejs/kit"; 2 3// export const prerender = true; 4 5export const GET: RequestHandler = async ({ url }) => { 6 const hostname = url.hostname; 7 const sitemapUrl = `https://${hostname}/sitemap.xml`; 8 const robots = [ 9 "User-agent: *", 10 "Allow: /", 11 "", 12 `Sitemap: ${sitemapUrl}`, 13 ].join("\n"); 14 15 return new Response(robots, { 16 headers: { 17 "Content-Type": "text/plain; charset=utf-8", 18 "Cache-Control": "public, max-age=3600", 19 "X-Content-Type-Options": "nosniff", 20 }, 21 }); 22};