Skip to content

Commit

Permalink
chore: update incorrect code comments regarding dynamicParams
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Mar 12, 2024
1 parent 218dbb1 commit f6d01f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/[locale]/feed/[feed]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const GET = async (_: Request, { params }: StaticParams) => {
export const generateStaticParams = async () =>
siteConfig.rssFeeds.map(feed => ({ feed: feed.file, locale }));

// Forces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary
// In this case we want to catch-all possible requests. This is so that if a non defined feed is
// requested we can manually return a 404 response for it instead of having Next.js handle it
// and return our top level custom 404 html page instead
// @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams
export const dynamicParams = true;

Expand Down
3 changes: 2 additions & 1 deletion app/[locale]/next-data/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const generateStaticParams = async () => [
// @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime
export const runtime = VERCEL_ENV ? 'edge' : 'nodejs';

// Enforces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary
// In this case we want to catch-all possible requests. This ensures that we always generate and
// serve the OpenGrapgh images independently on the locale
// @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams
export const dynamicParams = true;

Expand Down

0 comments on commit f6d01f6

Please sign in to comment.