Skip to content

Commit

Permalink
chore!: configure edge runtime for new routes
Browse files Browse the repository at this point in the history
  • Loading branch information
martian0x80 committed Sep 25, 2024
1 parent 8a63f5c commit a957cf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/[id]/sitemap.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getServerSideSitemap, ISitemapField } from "next-sitemap";
import { neon } from "@neondatabase/serverless";

export const runtime = 'edge';

async function getData(index: number) {
const sql = neon(process.env.SITEMAP_DB_URI || "", {
fetchOptions: { next: { revalidate: 1800 } },
Expand Down
4 changes: 3 additions & 1 deletion app/server-sitemap-[id].xml.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const runtime = 'edge';

export default function Page(
{params}:{
params:{
Expand All @@ -6,4 +8,4 @@ export default function Page(
}
) {
console.log(params.id)
}
}
4 changes: 3 additions & 1 deletion app/server-sitemap.xml/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { neon } from "@neondatabase/serverless";
import { NextRequest } from "next/server";
import { hostname } from "os";

export const runtime = 'edge';

async function getData() {
const sql = neon(process.env.SITEMAP_DB_URI || "", {
fetchOptions: { next: { revalidate: 1800 } },
Expand All @@ -18,6 +20,6 @@ export async function GET(request: NextRequest) {
{ length: Math.ceil(pages/25000) },
(_, i) => `${request.nextUrl.origin}/${i}/sitemap.xml`
);
// This should work
// This should work, dawg what
return getServerSideSitemapIndex(resultArray);
}

0 comments on commit a957cf9

Please sign in to comment.