Using var api = 'https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?lat=… works. Thanks!
Is there a way to cure this problem in the long run, or should we maybe change the API we use, and maybe even change the suggested API (openweathermap) in the challenge description itself? It is pretty discouraging for anyone who tries the challenge and doesn’t know that much about protocols, tricks and gotchas.
EDIT: After trying more weather APIs than I can count my fingers, I’ve come to a conclusion that openweathermap is a good first choice for this challenge/project after all. There are free APIs out there with https support, even with much better documentation and you should surely check them out, but I’ve had some serious troubles getting the right response for my coordinates, a lot of servers were just sending me the wrong info on each request.
Good luck to everyone who is doing this project, and keep on trying, you will learn A LOT from it!