Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Geolocation: Hello World

Demonstrates how to access and display geolocation data fields within a Cloudflare Worker using JavaScript, TypeScript, or Python.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Geolocation: Hello World

Demonstrates how to access and display geolocation data fields within a Cloudflare Worker using JavaScript, TypeScript, or Python.

When To Use

Use when you need to implement a Cloudflare Worker that retrieves and displays user location information such as country, city, or latitude and longitude in a web application.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-geolocation-hello-world-workflow-guide.mdA markdown guide demonstrating how to retrieve and display geolocation data fields within a Cloudflare Worker.Questions about a markdown guide demonstrating how to retrieve and display geolocation data fields within a Cloudflare Worker.
examples/workers-examples-geolocation-hello-world-cloudflare-workers-geolocation-.textA Cloudflare Workers script that uses the request.cf object to display geolocation data including country, city, and continent in an HTML response.Exact payloads, commands, or snippets shown in A Cloudflare Workers script that uses the request.cf object to display geolocation data including country, city, and...
examples/workers-examples-geolocation-hello-world-cloudflare-workers-geolocation--2.textA JavaScript Cloudflare Worker script that extracts and displays geolocation data such as country, city, and continent from the request object.Exact payloads, commands, or snippets shown in A JavaScript Cloudflare Worker script that extracts and displays geolocation data such as country, city, and continen...
examples/workers-examples-geolocation-hello-world-cloudflare-workers-geolocation--3.textA Python Worker script that uses the request.cf object to display the user's colocation, country, and city in an HTML response.Exact payloads, commands, or snippets shown in A Python Worker script that uses the request.cf object to display the user's colocation, country, and city in an HTML...
examples/workers-examples-geolocation-hello-world-cloudflare-workers-geolocation--4.textA Hono-based Cloudflare Worker script that extracts and displays geolocation data from the request object.Exact payloads, commands, or snippets shown in A Hono-based Cloudflare Worker script that extracts and displays geolocation data from the request object.

What This Skill Covers

  • Get all geolocation data fields and display them in HTML.
  • Main sections: Tags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/geolocation-hello-world