Access blocked by CORS policy

I am getting this error when I try to run my code locally. Anyone who can help troubleshoot?
Access to XMLHttpRequest at XXXXXXX from origin ‘http://localhost:3005’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

If you are using Spring Boot from backend service:

Are you using nginx or Apache ?

  • nothing yet

In your configurations, if you find something

You have to change config like below - it means it’s allow all requests from all origin
Access-Control-Allow-Origin “*”

Thanks, Ill check this out!