Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created April 8, 2016 05:50
Show Gist options
  • Save kbk0125/1bb90652614c3e676fcb832a5a829179 to your computer and use it in GitHub Desktop.
Save kbk0125/1bb90652614c3e676fcb832a5a829179 to your computer and use it in GitHub Desktop.
var request = require('request');
var app = require('express')();
var results;
function logRes(){
console.log(results);
}
app.get('/storeData', function(req,res){
readResult(logRes)
});
function readResult(callback){
request('http://someroute.com/api', function(err, response, body){
results=body;
callback();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment