mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-26 02:07:28 +08:00
87b0bca30c
* cloud doc * doc refactor * doc move * seo * remove doc * yml * doc * fix: tsconfig * fix: tsconfig
37 lines
686 B
TypeScript
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' }
|
|
});
|
|
}
|