Skip to content

Commit f18ec28

Browse files
committed
feat: add sitemap.xml redirection
1 parent 30dbeb4 commit f18ec28

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

next.config.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ let nextConfig = {
4141
"default-src 'self'; script-src 'none'; sandbox; style-src 'unsafe-inline';",
4242
},
4343

44+
async rewrites() {
45+
return {
46+
beforeFiles: [
47+
{ source: '/atom.xml', destination: '/feed' },
48+
{ source: '/sitemap.xml', destination: '/sitemap' },
49+
],
50+
}
51+
},
52+
4453
webpack: (config, options) => {
4554
config.externals.push({
4655
'utf-8-validate': 'commonjs utf-8-validate',

src/app/feed/route.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { escapeXml } from '~/lib/helper.server'
1010
import { getQueryClient } from '~/lib/query-client.server'
1111
import { apiClient } from '~/lib/request'
1212

13-
export const runtime = 'edge'
1413
export const revalidate = 60 * 60 // 1 hour
1514

1615
export async function GET() {

src/app/sitemap/route.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { getQueryClient } from '~/lib/query-client.server'
22
import { apiClient } from '~/lib/request'
33

4-
export const runtime = 'edge'
54
export const revalidate = 60 * 60 // 1 hour
65

76
export const GET = async () => {

0 commit comments

Comments
 (0)