Skip to content

Commit fc9d754

Browse files
committed
fix: API 응답 및 에러 처리 방식 수정
- API 응답이 404인 경우 클라이언트 라우팅으로 처리하도록 변경 - 에러 발생 시 기본 페이지로 리다이렉트 대신 클라이언트 라우팅으로 처리하도록 수정
1 parent e95c4b0 commit fc9d754

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

apps/web/middleware.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export default async function middleware(request: Request) {
1818
);
1919

2020
if (!response.ok) {
21-
return Response.redirect(url.origin, 302);
21+
// API 응답이 404인 경우 클라이언트 라우팅으로 처리
22+
return new Response(null, {
23+
status: 200,
24+
});
2225
}
2326

2427
const data = await response.json();
@@ -68,7 +71,9 @@ export default async function middleware(request: Request) {
6871
},
6972
});
7073
} catch (error) {
71-
// 에러 발생 시 기본 페이지로 리다이렉트
72-
return Response.redirect(url.origin, 302);
74+
// 에러 발생 시 클라이언트 라우팅으로 처리
75+
return new Response(null, {
76+
status: 200,
77+
});
7378
}
7479
}

0 commit comments

Comments
 (0)