mirror of
https://github.com/tabler/tabler.git
synced 2026-08-05 01:44:41 +04:00
d8956a06d6
Co-authored-by: Bartek <xbartoszdobija@gmail.com>
21 lines
497 B
TypeScript
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',
|
|
},
|
|
});
|
|
};
|