Skip to content

ReactJs receiving No 'Access-Control-Allow-Origin' header is present on the requested resource. #12

@procarrera

Description

@procarrera

Hi ! is there anyone to help me?
Everything was working ok till I start getting this error from server:

Access to XMLHttpRequest at 'https://newsapi.org/v2/everything?q=javascript+&language=en&sortBy=relevancy&pageSize=100&apiKey=MY-API' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I am calling the API directly from my frontend (react js) and print some news on my page. vey simple

ps: i have removed my api id from the above code....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions