1
0
mirror of https://github.com/tabler/tabler.git synced 2026-08-05 01:44:41 +04:00
Files
tabler/docs/pages/robots.txt.ts
T
2026-07-28 00:09:02 +02:00

21 lines
497 B
TypeScript

import type { APIRoute } from 'astro';
import { site } from '@shared/lib/site';
export const prerender = true;
export const GET: APIRoute = () => {
const isProduction = (process.env.NODE_ENV || 'production') === 'production';
const sitemapUrl = `${isProduction ? site.docsUrl : ''}/sitemap.xml`;
const body = `Sitemap: ${sitemapUrl}
User-agent: *
Disallow:${isProduction ? '' : ' /'}
`;
return new Response(body, {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
},
});
};