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 eaa777d commit 2177b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/posts/[slug]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {NextRequest, NextResponse} from "next/server";
import {getPostBySlug} from "../markdown";
import {getPostBySlug, getAllPosts} from "../markdown";


export async function GET(request: NextRequest, {params}: { params: { slug: string } }) {
Expand All @@ -10,6 +10,6 @@ export async function GET(request: NextRequest, {params}: { params: { slug: stri


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

0 comments on commit 2177b4d

Please sign in to comment.