Why won't my Github Pages site work with an application I created?

Helllo,

I have created a project that includes an API being used here. What is the reason why this will only work for my local machine I have created it on, but not when it goes public on GitHub?

Maybe some security reasons?

It’s requesting my ‘location’.
If I say no - nothing happens.
If I say yes AND: load explicit that unsecure script:
temperatur changes and I see a cloud etc

In chrome I see the following warning:
script.js:18 Mixed Content: The page at 'https://jgagan95.github.io/weather-app/' was loaded over HTTPS, but requested an insecure resource 'http://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/06139cc1fa97036542ef47814970dc5c/50.6520515,9.162437599999999'. This content should also be served over HTTPS.

1 Like

Hello @jgagan95,

I think @s-projects18 is right. Try to change your proxy link to https: https://cors-anywhere.herokuapp.com/

yeah, that was exactly the problem. Working now!