weather-api icon indicating copy to clipboard operation
weather-api copied to clipboard

CORS Issue:

Open dromerosalem opened this issue 2 years ago • 6 comments

The "Access to XMLHttpRequest at 'https://goweather.herokuapp.com/weather/{city}' from origin 'https://dromerosalem.github.io/' has been blocked by CORS policy" error indicates that the API trying to access does not allow cross-origin requests from your deployed GitHub Pages site. This is a security measure enforced by the server hosting the API.

Is it possible to enable CORS so we can deploy at GitHub pages.

dromerosalem avatar May 21 '23 11:05 dromerosalem

Thanks for raising the issue @dromerosalem Let me have a look over the next days if I can configure it in the server/app to allow it.

robertoduessmann avatar Jun 20 '23 15:06 robertoduessmann

@robertoduessmann have you configured and allowed it?

Shahzaibdev355 avatar Jul 27 '24 12:07 Shahzaibdev355

Sadly i didnt find a way to fix this yet @shahzaibfullStackdev355

I host the app at Heroku and I couldn't find an out-of-the-box solution to enable it.

I was reading some posts and it might be required to be solved via code when the apis are exposed https://stackoverflow.com/questions/57727921/cors-issues-github-pages-heroku

robertoduessmann avatar Aug 04 '24 17:08 robertoduessmann

ok, I will also try to figure it out how to fix this error

Shahzaibdev355 avatar Aug 11 '24 19:08 Shahzaibdev355

You will need a proxy for that @dromerosalem

rogueloop avatar Aug 27 '24 14:08 rogueloop

Sory for the delay to come back here @dromerosalem but i deployed the app under a new domain, can you pls try again with https://goweather.xyz/v2/weather/Berlin and see if you have the same issue still?

robertoduessmann avatar Oct 27 '25 21:10 robertoduessmann