Lab GuideWelcome
14:30 17:00

ISCTE / CLOUDFLARE WORKSHOP

Deploy to Region: Earth

Today you'll build one Cloudflare Worker and deploy it to Region: Earth: not one data centre, but Cloudflare's whole network at once. By 17:00 it will be:

  1. A Student Page: a Droid ID card with your name, a Star Wars Character you pick, and the facts of their homeworld. The page changes its look to match that planet: desert, ice, forest, lava...
  2. A Star Wars Droid: it plays your Character, in a tone you write, and answers questions live in front of the class. You'll build it by directing a Coding Agent.

You keep all of it: your Cloudflare account, your GitHub repo, and your live URL. And there are no API keys to sign up for today.

The Hub: the whole class, connected#

Your Worker won't live alone. The teacher runs one more Worker, the Hub, at https://arena.cf2026iscte.nobledemos.com, and it's on the projector all session. Every student Worker plugs into it:

THE WHOLE CLASS, CONNECTEDOne question. Every droid.
One question. Every droid. The HubOn the projectorTeacher’s account SAMEQUESTION Your Student WorkerYour Cloudflare account Classmate’s WorkerTheir own Cloudflare account Another Student WorkerAnother Cloudflare account … every droid in the room One question. Every droid. The HubOn the projectorTeacher’s account SAME QUESTION · AT ONCE Your Student WorkerYour Cloudflare account Classmate’s WorkerTheir Cloudflare account Another WorkerTheir Cloudflare account … every droid in the room
The same question, at the same time. Each Student Worker stays on its own account.The Hub, on the teacher’s account and shown on the projector, sends the same question at once to every Student Worker in the room: your Worker on your Cloudflare account and each classmate’s Worker on their own separate Cloudflare account.
  1. You join the class Directory. Once your page is live, you register it with the Hub. The Hub calls your Worker, checks that it answers correctly, and your Card appears on the projector next to everyone else's (in about 45 minutes). Every Card comes with a Pixel Droid, a little 16×16 robot drawn from your Worker's URL. It's the same droid on your own page.
  2. The Hub broadcasts questions. In Phase 2 the teacher presses Go, and the Hub sends the same question to every Droid in the room, six at a time. Each card on the projector lights up with whether your Droid answered and how fast. Then you get a few minutes to fix your code, push, and see your card turn green on the next Round.
  3. Everyone reads everyone's answers. After each Round, every Droid's answer is published on the Hub. The teacher puts the funniest ones on the big screen. There are no winners, just 40 Star Wars Characters in 40 different tones answering the same question.

That's a real production setup: one service calling 40 independently deployed services, owned by 40 different people, with timeouts, errors, logs and redeploys while it's live.

What's a Worker?#

A Worker is a small piece of JavaScript that runs on Cloudflare's network. There's no server to manage: you write a fetch function that gets a request and returns a response, and Cloudflare runs it.

Region: Earth#

On most clouds, the first question is "which region?": us-east-1, eu-west-1, and so on. Pick Virginia, and a visitor in Lisbon waits for every request to cross the Atlantic and back.

Workers have no region dropdown. One deploy puts your code in more than 300 cities worldwide, and each request runs in the data centre closest to whoever sent it. A visitor in Lisbon is served from Lisbon, and a visitor in Tokyo from Tokyo. Same code, same deploy, no extra work.

js
export default {
  async fetch(request, env) {
    return new Response(`Hello from Region: Earth! Served from ${request.cf?.colo}`);
  },
};

request.cf.colo is the code of the data centre that ran your code (for example LIS for Lisbon). You'll see it for yourself once you deploy.

That's a complete Worker. Everything today builds on these 5 lines.

How today works#

Phase 1 — your Student PagePhase 2 — your Droid
You learnDeploying, config, calling an API with chained fetch calls and caching, all by handWorkers AI, directing a Coding Agent, debugging in production
You finish withA live Student Page + your Card on the projectorA Droid that answers in character
  • Every step ends with a Check. If you pass it, move on.
  • Stuck for more than 5 minutes? Open "Show solution", paste it, and keep going. That's allowed and expected.
  • Moving fast? Look for Stretch boxes.

Next: Setup: start by creating your Cloudflare account

Your project

Pick your Droid Name first. Add the rest when you know it; every field is optional. These details stay in this browser and are never sent anywhere.

A nickname, not your full name. Used for your Student Worker and repo. Lowercase letters, numbers and hyphens; up to 40 characters.

The workers.dev subdomain you choose at signup. Same naming rules as your Droid Name.

Add this later, or paste a GitHub repo URL to fill your username and Droid Name.

My URL is different

Optional. Use your public https://…workers.dev URL. Paths and trailing slashes are removed. Leave blank to use your Droid Name and subdomain.

LIVE PREVIEW

Your droid will live at https://<your-droid-name>.<your-subdomain>.workers.dev

Your repo: github.com/<your-github-user>/<your-droid-name>