Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Update route.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriae authored Apr 13, 2024
1 parent 8ab5901 commit eaa777d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/api/posts/[slug]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ export async function GET(request: NextRequest, {params}: { params: { slug: stri
const slug = params.slug;
const post = getPostBySlug(slug);
return NextResponse.json(post);
}
}


export async function generateStaticParams() {
const slugs = await getAllSlugs();
return slugs.map((slug) => ({ slug }));
}

0 comments on commit eaa777d

Please sign in to comment.