mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: robots.txt file
This commit is contained in:
1 parent
7b1fedf657
commit
dfc55b745b
3 files changed
+20
-9
No files matched your search
@@ -1,7 +0,0 @@
|
|||||||
User-agent: *
|
|
||||||
Allow: /
|
|
||||||
|
|
||||||
Host: https://blitzkit.app
|
|
||||||
|
|
||||||
Sitemap: https://blitzkit.app/sitemap.txt
|
|
||||||
Sitemap: https://blitzkit.app/sitemap.xml
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
import { assertSecret } from '@blitzkit/core';
|
import { assertSecret } from '@blitzkit/core';
|
||||||
import type { APIContext } from 'astro';
|
import type { APIContext } from 'astro';
|
||||||
|
|
||||||
export const prerender = false;
|
|
||||||
|
|
||||||
export async function GET({}: APIContext) {
|
export async function GET({}: APIContext) {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`https://api.nitropay.com/v1/ads-${assertSecret(
|
`https://api.nitropay.com/v1/ads-${assertSecret(
|
||||||
|
|||||||
@@ -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
|
||||||
|
`
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user