Hi I get problem to fetch content of web page. Please see my code below
var http = require('http');
var html = '';
var options = {
host: 'dev.gunship.io',
path: '/node.html'
};
callback = function(response) {
response.on('data', function(chunk) {
html += chunk;
});
response.on('end', function() {
//console.log(html);
});
};
http.request(options, callback).end();
console.log(html);
Why my console not log anything..? Thank you for any help