Created
February 25, 2017 15:52
-
-
Save adispen/93c847413e7b0389d42a5d950f759caf 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 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