Files
portfolio/app/robots.txt/route.ts
2026-01-12 15:27:35 +00:00

26 lines
536 B
TypeScript

import { NextResponse } from "next/server";
import { getBaseUrl } from "@/lib/seo";
export const dynamic = "force-dynamic";
export async function GET() {
const base = getBaseUrl();
const body = [
"User-agent: *",
"Allow: /",
"Disallow: /api/",
"Disallow: /manage",
"Disallow: /editor",
`Sitemap: ${base}/sitemap.xml`,
"",
].join("\n");
return new NextResponse(body, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
"Cache-Control": "public, max-age=3600",
},
});
}