Created
April 27, 2015 14:37
-
-
Save tiansial/555039ad6a71f4ea274e to your computer and use it in GitHub Desktop.
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
var request = require('request'); | |
function(req, res) { | |
request.get('http://api.openweathermap.org/data/2.5/weather?q=Viseu,pt', function(err, response, body) { | |
if (!err && response.statusCode == 200) { | |
var locals = JSON.parse(body); | |
res.render('index', locals); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment