Jiseoup/showmycodePublic
EN|KO
  • 코드
  • 커밋
  • 풀 리퀘스트
← 목록으로
Merged

fix: await async params in GitHub API route for Next.js 16

#4
JiseoupJiseoup · 2026년 3월 31일fix/api-route-params → main
fix
개요커밋변경된 파일
변경된 파일

+3 -2 · 1개

@@ -6,9 +6,10 @@ const PAT = process.env.GITHUB_PAT!;
export async function GET(
req: NextRequest,
- { params }: { params: { path: string[] } }
+ { params }: { params: Promise<{ path: string[] }> }
) {
- const ghPath = params.path.join("/");
+ const { path } = await params;
+ const ghPath = path.join("/");
// repos/{owner}/{repo}/... 형태에서 owner, repo 추출 후 허용 목록 검사
const match = ghPath.match(/^repos\/([^/]+)\/([^/]+)/);