import type { APIRoute } from 'astro'; // 샘플: 전면 차단. 프로덕션(PUBLIC_INDEXABLE=true): 전면 허용 + AI 크롤러 명시 허용. const AI_BOTS = ['GPTBot', 'OAI-SearchBot', 'ChatGPT-User', 'PerplexityBot', 'ClaudeBot', 'Claude-SearchBot', 'Google-Extended', 'Applebot-Extended', 'Bingbot', 'Yeti', 'Googlebot']; export const GET: APIRoute = ({ site }) => { const indexable = import.meta.env.PUBLIC_INDEXABLE === 'true'; const body = indexable ? [...AI_BOTS.map((b) => `User-agent: ${b}\nAllow: /`), 'User-agent: *\nAllow: /', `Sitemap: ${site}sitemap.xml`].join('\n\n') + '\n' : `# 샘플 사이트. 색인 금지.\nUser-agent: *\nDisallow: /\n`; return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }); };