Skip to content

Instantly share code, notes, and snippets.

@Kalaborative
Created May 22, 2020 21:23
Show Gist options
  • Save Kalaborative/439e8d0370ed106c08e52d786df69c5f to your computer and use it in GitHub Desktop.
Save Kalaborative/439e8d0370ed106c08e52d786df69c5f to your computer and use it in GitHub Desktop.
fetch('https://ipapi.co/json/').then( res => res.json()).then((res) => {
let user_IP = res.ip;
let city = res.city;
let region = res.region;
let userLocation = `${city}, ${region} - IP: ${user_IP}`
console.log(userLocation)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment