Welcome aboard! We are happy you are here and wish you good net-raft!
var http = require('http');
const request = require('request');
var srv = http.createServer(function (req, res) {
request('http://maps.googleapis.com/maps/api/geocode/json?latlng=40.7118,-111.9679&sensor=true' ,
function(error, res1, body) {
var mylocation = JSON.parse(body);
var text;
text = mylocation.results[4].formatted_address;
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(text);
});
});
srv.listen(3000);
console.log("Listening to Port 3000");
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.5K 1.7K