Open heron2014 opened 8 years ago
api - here sign up for api keys
endpoint: api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
to see what data you get from the api call , type:
http://api.openweathermap.org/data/2.5/forecast?q=London,us&appid=yourapikey
to use this url in the application , use es6 template strings syntax (use backtics):
const ROOT_URL = http://api.openweathermap.org/data/2.5/forecast?appid=${API_KEY}
http://api.openweathermap.org/data/2.5/forecast?appid=${API_KEY}
then we can formulate query like this (use backtics):
const url = ${ROOT_URL}&q=${city},uk;
${ROOT_URL}&q=${city},uk
api - here sign up for api keys
endpoint: api.openweathermap.org/data/2.5/forecast?q={city name},{country code}
to see what data you get from the api call , type:
http://api.openweathermap.org/data/2.5/forecast?q=London,us&appid=yourapikey
to use this url in the application , use es6 template strings syntax (use backtics):
const ROOT_URL =
http://api.openweathermap.org/data/2.5/forecast?appid=${API_KEY}
then we can formulate query like this (use backtics):
const url =
${ROOT_URL}&q=${city},uk
;To make a ajax call to the api we can use instead of jquery (which has lots of funtionalities) - use axios