2025-09-15 16:58:31 +08:00

88 lines
3.7 KiB
TypeScript

import { NextResponse } from 'next/server';
export async function GET() {
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/sitemap.xsl"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<!-- Default language pages -->
<url>
<loc>http://localhost:3000/zh-CN</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en"/>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<!-- About pages -->
<url>
<loc>http://localhost:3000/zh-CN/about</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN/about"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW/about"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/about"/>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<!-- Services pages -->
<url>
<loc>http://localhost:3000/zh-CN/services</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN/services"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW/services"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/services"/>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<!-- Solutions pages -->
<url>
<loc>http://localhost:3000/zh-CN/solutions</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN/solutions"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW/solutions"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/solutions"/>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<!-- Pricing pages -->
<url>
<loc>http://localhost:3000/zh-CN/pricing</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN/pricing"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW/pricing"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/pricing"/>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<!-- News pages -->
<url>
<loc>http://localhost:3000/zh-CN/news</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN/news"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW/news"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/news"/>
<changefreq>daily</changefreq>
<priority>0.7</priority>
</url>
<!-- Contact pages -->
<url>
<loc>http://localhost:3000/zh-CN/contact</loc>
<xhtml:link rel="alternate" hreflang="zh-CN" href="http://localhost:3000/zh-CN/contact"/>
<xhtml:link rel="alternate" hreflang="zh-TW" href="http://localhost:3000/zh-TW/contact"/>
<xhtml:link rel="alternate" hreflang="en" href="http://localhost:3000/en/contact"/>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
</urlset>`;
return new NextResponse(sitemap, {
headers: {
'Content-Type': 'application/xml',
'Cache-Control': 'public, max-age=3600, s-maxage=3600',
},
});
}