Skip to content

Commit b6a7244

Browse files
committed
fix: /api 경로만 프록시하도록 필터링 추가하여 페이지 라우트 간섭 제거
1 parent 03ac74d commit b6a7244

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/app/api/[...path]/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ async function proxy(
1313
req: NextRequest,
1414
ctx: { params: Promise<{ path: string[] }> },
1515
) {
16+
if (!req.nextUrl.pathname.startsWith("/api/")) {
17+
return NextResponse.next();
18+
}
19+
1620
// 프록시 대상 경로 생성
1721
const { path: rawPath } = await ctx.params;
1822
const path = "/" + rawPath.join("/");

src/app/detail/[postingId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default async function Page({
1414
}: {
1515
params: { postingId: string };
1616
}) {
17-
const { postingId } = params;
17+
const { postingId } = await params;
1818
const id = Number(postingId);
1919
const queryClient = new QueryClient();
2020

0 commit comments

Comments
 (0)