January 2018
Beginner
658 pages
13h 10m
English
Now in order to play around with the weather API, we'll take the exact same URL we have defined in the previous section, and we'll make a request in app.js. First, we want to do a little setup work.
Inside of app.js, we'll comment out everything we have so far, and next to our API key we'll make a call to request, requesting this exact URL, just like we did for the geocode API in the previous section/chapter, before we made it dynamic. Then we'll print out the body.currently.temperature property to the screen, so when we run the app we'll see the current temperature for whatever latitude and longitude we used. In our case it's a static latitude and longitude representing Philadelphia. ...
Read now
Unlock full access