Link Search Menu Expand Document

Geolocation

Return the country of a user.

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  const countryCode = request.bip.country
  return new Response(`You reside in country: ${countryCode}`)
}

© 2021 Bip.sh, Ltd.