• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

axios로 뉴스 정보가 들어오지 않습니다.

22.05.25 05:28 작성 조회수 249

0

안녕하세요 강사님.

말씀하신대로 axios url 앞에 추가로 주소(https://secret-ocean-49799.herokuapp.com/) 를 붙혔는데도 뉴스가 들어오질 않네요.  

구글링을 해서 다른 주소 (https://cors-anywhere.herokuapp.com/)를 붙혔는데도 마찬가지이구요, 강사님 github 코드를 붙혀도 마찬가지이네요.

export default {
  async created() {
    const CORS_PROXY = "https://secret-ocean-49799.herokuapp.com/";
    const response = await this.$axios.get(
      CORS_PROXY +
        "https://news.google.com/rss?hl=ko&gl=KR&ceid=KR:ko"
    );
    console.log(response);
};

 

콘솔창에 뜨는 에러 메세지는: 

GEThttps://secret-ocean-49799.herokuapp.com/https://news.google.com/rss?pz=1&cf=all&hl=ko&gl=KR&ceid=KR:koCORS Missing Allow Origin

 

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://secret-ocean-49799.herokuapp.com/https://news.google.com/rss?pz=1&cf=all&hl=ko&gl=KR&ceid=KR:ko. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 404.

 

Uncaught (in promise) Error: Network  Error createError.js:16

 

이렇게 3개인데요, 지금 꽤 시간을 투자해서 잡고 있는데 진전이 없어서 문의드립니다.

답변 4

·

답변을 작성해보세요.

0

김정호님의 프로필

김정호

2022.11.24

이거 안되는데.... 수정하시거나 다시 영상좀..

0

gunho30811님의 프로필

gunho30811

2022.10.26

    const response = await parser.parseURL('http://cors-anywhere.herokuapp.com/https://news.google.com/rss?hl=ko&gl=KR&ceid=KR:ko') // eslint-disable-line no-unused-vars

이런식으로 하시면 될 거 같아요

0

이응치읓님의 프로필

이응치읓

2022.08.10

https://newsapi.org/

예전 자료라 url이 안되는 것 같은데...

가짜 뉴스 API로 진행해야할 것 같아요...

0

elia85328472님의 프로필

elia85328472

2022.07.26

저도 다른 우회 싸이트 붙여도 이런데 어떻게 해결하셨나요?