Last active
April 24, 2018 19:17
-
-
Save bmorelli25/cefc87d069721517c8ebcb93b5997a22 to your computer and use it in GitHub Desktop.
Node.js Weather App - part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let request = require('request'); | |
let apiKey = '*****************************'; | |
let city = 'portland'; | |
let url = `http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}` | |
request(url, function (err, response, body) { | |
if(err){ | |
console.log('error:', error); | |
} else { | |
console.log('body:', body); | |
} | |
}); |
I saved the file in UTF-8 format and it worked!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for that awesome post on medium, learnt a lot..
but when i started coding it, i got this error...help me out please
I created index.js file by navigating to the folder i created ->right click->new->notepad->save as-> named it as "index.js"