Files
FastGPT/document/app/robots.txt/route.ts
T
Archer 87b0bca30c Doc (#6493)
* cloud doc

* doc refactor

* doc move

* seo

* remove doc

* yml

* doc

* fix: tsconfig

* fix: tsconfig
2026-03-03 17:39:47 +08:00

37 lines
686 B
TypeScript

import { NextResponse } from 'next/server';
export const dynamic = 'force-static';
export function GET() {
const homeDomain = process.env.FASTGPT_HOME_DOMAIN ?? 'https://fastgpt.io';
const domain = homeDomain.replace('https://', 'https://doc.');
const isCN = homeDomain.includes('.cn');
let content: string;
if (isCN) {
content = `User-Agent: Googlebot
Disallow: /
User-Agent: *
Allow: /
Host: ${domain}
Sitemap: ${domain}/sitemap.xml
`;
} else {
content = `User-Agent: bingbot
Disallow: /
User-Agent: *
Allow: /
Sitemap: ${domain}/sitemap.xml
`;
}
return new NextResponse(content, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' }
});
}