Closed WonhyeongLee closed 6 months ago
MSW을 사용해 아래 코드와 같이 membershipInformation을 /api/membership-information 에서 반환하도록 구현했는데
membershipInformation
/api/membership-information
export const handlers = [ http.get('/api/membership-information', () => { return HttpResponse.json(membershipInformation); }), ];
이걸 배포하기 위해 Next의 api/membership-information/route.ts 에 해당 요청에 대해 json데이터를 반환하도록 구현합니다.
api/membership-information/route.ts
json
배포환경에서 Mock api 대신 배포주소/api/membership-information 에 데이터를 요청할 수 있게 구현합니다.
A branch has been created for this issue: feature/26-add_membership-information_api_endpoint.
개요
MSW을 사용해 아래 코드와 같이
membershipInformation
을/api/membership-information
에서 반환하도록 구현했는데이걸 배포하기 위해 Next의
api/membership-information/route.ts
에 해당 요청에 대해json
데이터를 반환하도록 구현합니다.예상 결과
배포환경에서 Mock api 대신 배포주소
/api/membership-information
에 데이터를 요청할 수 있게 구현합니다.