var app = require('express')();
var listener = app.listen(8888, function(){
console.log('Listening on port ' + listener.address().port); //Listening on port 8888
});
Если нет, то: https://nodejs.org/api/http.html#http_server_liste... var req = require('request');
var Q = require('q');
function getPage(url) {
var deferred = Q.defer();
req(url, function(err, r, body) {
if (error || r.statusCode != 200) {
deferred.reject(new Error(err));
} else {
deferred.resolve(body);
}
});
return deferred.promise;
}
getPage('http://google.com').then(function(body) {
console.log(body);
});