Skip to content

Instantly share code, notes, and snippets.

@tiansial
Created April 27, 2015 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiansial/555039ad6a71f4ea274e to your computer and use it in GitHub Desktop.
Save tiansial/555039ad6a71f4ea274e to your computer and use it in GitHub Desktop.
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