Skip to content

Instantly share code, notes, and snippets.

View danielimmke's full-sized avatar
🤺

Daniel Immke danielimmke

🤺
View GitHub Profile
@danielimmke
danielimmke / robots-txt.ts
Created January 23, 2024 22:11
Example of a dynamic robots.txt that is sensitive to .env
// routes/robots.txt/+server.ts
import { env } from "$env/dynamic/private";
export function GET() {
let rules = [
'User-agent: *'
]
if(env.ORIGIN === 'https://example.com') {
rules.push('Disallow: /*.js$')