Created
December 3, 2022 15:52
-
-
Save nomadrat/aea5e1303e21d3b6118ff82cbe31455b to your computer and use it in GitHub Desktop.
How To Access Cloudflare Worker From The Browser
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
| async function fetchVisitorGEO() { | |
| const response = await fetch('https://empty-bird-5317.your-name.workers.dev/'); | |
| const ipInfo = await response.json(); | |
| console.log(ipInfo); | |
| } | |
| fetchVisitorGEO(); | |
| /** OR */ | |
| window.fetch("https://empty-bird-5317.your-name.workers.dev/") | |
| .then(r => r.json()).then((ipInfo)=> console.log(ipInfo)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment