Local Weather App seems to stopped working since https?

My Local weather app seems to have stopped working since the change to https by codepen…
I was using ipinfo for the local and openweathermap for the weather data.Does anyone know of a way to fix this without reforming a large section of the code?

Try adding https://cors-anywhere.herokuapp.com/ at the beginning of your URL.

1 Like

Like the original poster, my local weather app also uses ipinfo to pull local lat & long to feed into open weather app, both are HTTP and the app stopped working when codepen enforced HTTPS.

I prepended the cors-anywhere to both HTTP urls which revives the app, but the app then starts showing the weather of Ashburn Virginia (this must be the location where herokapp.com is based) and not that of the local location.

Some suggested to switch to DarkSky but I find it has too many restrictions on free loaders and too hard for beginners to implement their own servers to pull weather info from DarkSky and in turn feed to client apps.

A few people suggested Google API which I plan to have a stab to see how that turns out.

you could use a different API for the IP address – I used https://ipapi.co/

Thanks! So using this https://ipapi.co/ means I wont need to prepend cors-anywhere to it, thus should be able to avoid the real location being overridden right ?

Yes, exactly – and you’re correct that you were getting a Virginia location because of the heroku server

1 Like

Update : I found out 2+ weeks ago https://ipapi.co no longer returns the correct city location based on current IP address. It returns the location of your ISP instead (silly).

I changed my code to use native geolocation API instead. See this thread API (https://ipapi.co/json) used in local weather app not showing correct location

1 Like