Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created April 8, 2016 05:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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