http.get.js 309 B

1234567891011
  1. /*
  2. http.get Request the content from URL with GET method
  3. */
  4. requirelib("http")
  5. //Get the weather information from API endpoint
  6. var weatherInfo = http.get("https://fcc-weather-api.glitch.me/api/current?lat=22.42649285936068&lon=114.21116977093158");
  7. //Relay the JSON to client
  8. sendJSONResp(weatherInfo);