node-host
node-host copied to clipboard
can't make http.get to work
trafficstars
Am i doing something wrong?
var http = require('http'),
url = require('url');
exports.app = function(req, res){
var options = {
host: 'www.google.com',
port: 80,
path: '/'
};
http.get(options, function(r) {
var data = '';
r.on('data', function(chunk) {
data += chunk;
});
r.on('end', function() {
res.end(data);
});
}).on('error', function(e) {
res.end("Got error: " + e.message);
});
}
hey did u figure it out...how to do