/[sudobot]/trunk/docs/app/sitemap_index.xml/route.ts
ViewVC logotype

Contents of /trunk/docs/app/sitemap_index.xml/route.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 627 - (show annotations)
Sat Sep 7 09:42:28 2024 UTC (6 months, 3 weeks ago) by rakinar2
File MIME type: application/typescript
File size: 590 byte(s)
chore: add new files

1 import { absoluteURL } from "@/utils/utils";
2 import { NextResponse } from "next/server";
3
4 export async function GET() {
5 const sitemaps = ["/sitemap.xml", "/blog/sitemap.xml"];
6
7 return new NextResponse(
8 `<?xml version="1.0" encoding="UTF-8"?>\n
9 <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
10 ${sitemaps.map(sitemap => `<sitemap><loc>${absoluteURL(sitemap)}</loc></sitemap>`).join("")}
11 </sitemapindex>
12 `,
13 {
14 headers: {
15 "Content-Type": "application/xml",
16 },
17 },
18 );
19 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26