Skip to content

Instantly share code, notes, and snippets.

@adispen
Created February 25, 2017 15:52
Show Gist options
  • Save adispen/93c847413e7b0389d42a5d950f759caf to your computer and use it in GitHub Desktop.
Save adispen/93c847413e7b0389d42a5d950f759caf to your computer and use it in GitHub Desktop.
var request = require('request');
function callback(){
console.log('-------------------------------------------------------THIS ONE IS IN A CALLBACK');
}
function getJSON(callback) {
request('http://localhost/cinema.json', function(error, response, body) {
if(!error && response.statusCode == 200) {
console.log(body);
callback();
}
});
}
getJSON(callback);
console.log('-----------------------------------------------After Execution');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment