Skip to content

Instantly share code, notes, and snippets.

@rootmos
Created December 27, 2018 09:02
Show Gist options
  • Select an option

  • Save rootmos/bb1edd07c9e6f9c7a04f7ec3fda0ba19 to your computer and use it in GitHub Desktop.

Select an option

Save rootmos/bb1edd07c9e6f9c7a04f7ec3fda0ba19 to your computer and use it in GitHub Desktop.
var http = require('http');
var request = require('request');
http.createServer(function (req, res) {
request('https://ip.rootmos.io/ip', function (error, response, body) {
res.write(body);
res.end();
});
}).listen(8080);
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"request": "^2.88.0"
},
"scripts": {
"start": "node index.js"
},
"devDependencies": {},
"author": "",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment