Skip to content

Instantly share code, notes, and snippets.

@pbzona
Created April 30, 2018 21:59
Show Gist options
  • Save pbzona/0374e0d8eb9339a919a0db65bc884e67 to your computer and use it in GitHub Desktop.
Save pbzona/0374e0d8eb9339a919a0db65bc884e67 to your computer and use it in GitHub Desktop.
Serverless Weather pt 3
// Make the request using axios, a promise-based HTTP library
axios.get(weatherURL).then((response) => {
// Once the response is received, pull the different parameters we'll need and save them as variables
const tomorrow = response.data.daily.data[1];
const high = Math.round(tomorrow.temperatureHigh);
const low = Math.round(tomorrow.temperatureLow);
const precip = Math.round(tomorrow.precipProbability * 100);
const summary = tomorrow.summary;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment