forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobots.ts
More file actions
25 lines (22 loc) · 759 Bytes
/
Copy pathrobots.ts
File metadata and controls
25 lines (22 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Next.js App Router robots config. Allows all user-agents across the
// public docs surface, blocks the internal `/api/` routes, and points
// crawlers at sitemap.xml so they can discover every framework variant.
import type { MetadataRoute } from "next";
import { getBaseUrl } from "@/lib/sitemap-helpers";
// Force-dynamic so the emitted sitemap URL reflects the live
// NEXT_PUBLIC_BASE_URL at request time — see app/sitemap.ts for the
// same rationale.
export const dynamic = "force-dynamic";
export default function robots(): MetadataRoute.Robots {
const baseUrl = getBaseUrl();
return {
rules: [
{
userAgent: "*",
allow: "/",
disallow: "/api/",
},
],
sitemap: `${baseUrl}/sitemap.xml`,
};
}