CORS 에러

N·2023년 2월 7일
0

에러 :
Access to XMLHttpRequest at 'https://e833-222-233-138-154.jp.ngrok.io/topics/2' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

원인 : No 'Access-Control-Allow-Origin' header, 헤더에 해당 부분이 누락되어있었다

해결방법 : 헤더를 수정해주었다

.get(`/topics/${id}`, {
        headers: {
          'Access-Control-Allow-Origin': '*',
          'ngrok-skip-browser-warning': 'any',
        },
      })
profile
web

0개의 댓글

관련 채용 정보