인프런 커뮤니티 질문&답변

김태진님의 프로필 이미지

작성한 질문수

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

검증 라이브러리와 공통컴포넌트 재사용

netlify 배포시 cors 문제

해결된 질문

23.02.27 20:44 작성

·

837

0

 안녕하세요 자유게시판을 어느정도 구현해서 netlify를 통해 배포해보려고 하니 cors 문제로 api가 작동하지 않습니다. 어떻게 해야 해결할 수 있을까요 ?

 

Access to fetch at 'https://backendonline.codebootcamp.co.kr/graphql' from origin 'https://brilliant-rabanadas-0c6769.netlify.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:3000' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

답변 1

0

안녕하세요 태진님!

해당 CORS 에러는 백엔드측에서 접속 허용주소를 localhost 3000번만 열어놓았기 때문에 뜨는 것 입니다.
코드캠프의 백엔드 측에서 태진님의 가비아 주소에도 접속허용을 해드려야 하는데, 인프런 강의형 분들께는 제공하고있지않습니다.

감사합니다.😁