This hands-on lab introduces participants to serverless development on Cloudflare by building a lightweight, one-page expense tracker application. Participants will learn how to serve a dynamic UI directly from the edge using Cloudflare Workers and persist user data globally with low latency using Workers KV.
Step-by-step hands-on modules
Initialize a new Cloudflare Worker project and configure it to serve a static HTML/CSS one-page application. Focus on the fetch event handler to return the UI assets directly from the edge, replacing the default "Hello World" response.
Key Steps:
Integrate Workers KV into the application. Write the serverless functions (within the Worker) to handle PUT, GET, and DELETE requests for expense data, and bind the Worker to a local KV namespace.
Key Steps:
Move from local development (wrangler dev) to multiple environments such as staging and production. Deploy the Worker and KV bindings to Cloudflare's global network using Wrangler. Verify the live URL, test data persistence in the production environment, and briefly review usage logs in the Cloudflare dashboard.
Key Steps:
Join the hands-on session and build something real.