feat: robots.txt file

This commit is contained in:
TrèsAbhi committed 2024-10-14 10:47:49 -05:00
1 parent 7b1fedf657
commit dfc55b745b
3 files changed
+20 -9

No files matched your search

-7
View File
@@ -1,7 +0,0 @@
User-agent: *
Allow: /
Host: https://blitzkit.app
Sitemap: https://blitzkit.app/sitemap.txt
Sitemap: https://blitzkit.app/sitemap.xml
-2
View File
@@ -1,8 +1,6 @@
import { assertSecret } from '@blitzkit/core';
import type { APIContext } from 'astro';
export const prerender = false;
export async function GET({}: APIContext) {
const response = await fetch(
`https://api.nitropay.com/v1/ads-${assertSecret(
+20
View File
@@ -0,0 +1,20 @@
import { assertSecret } from '@blitzkit/core';
import type { APIContext } from 'astro';
export async function GET({}: APIContext) {
const allowRobots = assertSecret(import.meta.env.ALLOW_ROBOTS) === 'true';
return new Response(`
User-agent: *
${allowRobots ? 'Allow' : 'Disallow'}: /
${
allowRobots
? `
Host: https://blitzkit.app
Sitemap: https://blitzkit.app/sitemap.txt
`
: ''
}
`);
}