Created
November 14, 2018 10:39
-
-
Save indatawetrust/ea5d3e87e9e5c7ff633fccc7beabf2e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
https.get('https://ifconfig.co/json', resp => { | |
let data = ''; | |
resp.on('data', chunk => { | |
data += chunk; | |
}); | |
resp.on('end', () => { | |
const body = JSON.parse(data); | |
console.log(body.ip); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment