/** * IndexNow key file — GET /indexnow-key.txt * * Brainerce's SEO Autopilot pings IndexNow (instant search-engine indexing) * whenever a blog post publishes. The ping includes * `keyLocation: https:///indexnow-key.txt`, and search engines * verify ownership by fetching this file and matching the key. * * The key comes from `getStoreInfo().seo.indexNowKey` — it is NOT a secret * (the file is public by protocol design). Returns 404 until the platform * generates a key for this sales channel, which is harmless. */ import { getServerClient } from '@/core/lib/brainerce.server'; export const revalidate = 3600; export async function GET() { const client = await getServerClient(); const info = await client.getStoreInfo().catch(() => null); const key = info?.seo?.indexNowKey; if (!key) return new Response(null, { status: 404 }); return new Response(key, { headers: { 'Content-Type': 'text/plain; charset=utf-8' }, }); }