Jiseoup/showmycodePublic
EN|KO
  • Code
  • Commits
  • Pull Requests
← Back to list
Merged

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

#4
JiseoupJiseoup · Mar 31, 2026fix/api-route-params → main
fix
OverviewCommitsFiles changed
Changed files

+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\/([^/]+)\/([^/]+)/);