Files
website/src/routes/robots.txt/+server.ts
Stan Runge d0c7b6548b
Some checks failed
Test and deploy staging / staging (push) Has been cancelled
beeeeg update
2026-09-23 04:16:50 +00:00

16 lines
482 B
TypeScript

import { SITE_ORIGIN } from '$lib/seo';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = ({ url }) => {
const production = url.hostname === new URL(SITE_ORIGIN).hostname;
const body = production
? `User-agent: *\nAllow: /\nSitemap: ${SITE_ORIGIN}/sitemap.xml\n`
: 'User-agent: *\nDisallow: /\n';
return new Response(body, {
headers: {
'content-type': 'text/plain; charset=utf-8',
'cache-control': 'public, max-age=3600'
}
});
};