Cloudflare
case-study
Browse
Find courses, lessons, articles, talks, and podcasts.
63 results for "cloudflare"
Showing 1–24 · Page 1 of 3
case-study
article
Hey Everyone 👋, John Lindquist here with the **sixth issue of AI Dev Essentials!** The AI coding landscape continues its rapid evolution, and this week is packed with significant updates. Cursor has rolled out its major 0.50 release, overhauling pricing, supercharging its AI features, and refining the developer experience. We're also seeing exciting new open-source entrants like the Zed code editor and the Cloudflare Agent Framework, plus fresh practical tips for your AI-assisted workflows. There's a lot to unpack, so let's dive in! --- ### New egghead.io Lessons This Week * **[Clean up Legacy Functions for Testability in Cursor (0.50+) with cmd+k](https://egghead.io/clean-up-legacy-functions-for-testability-in-cursor-0-50-with-cmd-k~x1wb0)** Learn to refactor legacy code by extracting logic into new, top-level functions using Cursor's "Edit Full File" mode (Cmd+K then Cmd+Shift+Enter). This lesson shows how to break down monolithic functions into smaller, testable units and use "Fix in Chat" for quick error resolution, making your codebase more modular and maintainable. * **[Automatically Improve Cursor Rules Using Custom Prompts](https://egghead.io/automatically-improve-cursor-rules-using-custom-prompts~5010d)** Refine unclear AI prompts or Cursor rules (.mdc files) by referencing a dedicated "best practices" rule file directly within Cmd+K. This lesson demonstrates how to instantly improve instruction clarity and leverage your own standards for better AI outcomes, with an option to have the AI Agent explain the improvements. --- ## 🚀 Cursor 0.50 Update: Key Enhancements _Cursor's significant 0.50+ update simplifies pricing, boosts AI capabilities, and refines the developer experience. Highlights from their [changelog](https://www.cursor.com/changelog):_ ### Simplified Pricing & Enhanced Model Access Cursor introduces a unified, request-based pricing model. Max Mode, for demanding tasks, now offers token-based access to all top models. (*Note: Older Cursor versions will have access to previous MAX versions and long context mode for a few more weeks before they are sunset. [Read more about Max Mode](https://docs.cursor.com/max-mode).*) ### Advanced AI, Agentic Features & Broader Context AI capabilities are enhanced with a new Tab Model for multi-file changes, a Background Agent (preview) for parallel tasks ([read more](https://docs.cursor.com/background-agent)), the ability to include the entire codebase in context using `@folders`, and fast agent-assisted edits in long files. ### Streamlined Workflow & Developer Experience Developer workflow is streamlined with a refreshed Inline Edit (Cmd/Ctrl+K) integrated with agent options, support for multi-codebase projects via Workspaces, and improved chat features like markdown export and duplication. --- ## 🛠️ Dev Tooling, Frameworks & Ecosystem _The developer ecosystem keeps expanding with new frameworks, SDKs, and practical agentic workflows._ * **Zed: The World's Fastest AI Code Editor** Zed is a new, open source, Rust-based code editor designed for agentic, collaborative editing. Features include automatic context discovery, real-time agent streaming, and extensibility via MCPs and tools. ([Zed](https://x.com/zeddotdev/status/1920102691365138826), [Blog](https://zed.dev/blog/fastest-ai-code-editor?x=60)) * **Cloudflare Agent Framework Video & Demo** Craig Dennis shows off the Cloudflare Agent Framework: synchronized agent state, client-side SQL storage, durable execution of third-party APIs (like YouTube), and human-in-the-loop RPC. [Watch the video](https://www.youtube.com/watch?v=ULu8hjFe_S0) | [GitHub](https://github.com/craigsdennis/kudos-agent) ([Craig Dennis](https://x.com/craigsdennis/status/1920643394872762487)) * **Mermaid Diagrams Coming to Cursor** The Cursor team announced that they will support Mermaid diagrams—great for visualizing complex code and data pipelines. ([ian](https://x.com/shaoruu/status/1922183290896744816)) * **AI SDK 5 Preview: UI Message Persistence** Store UI messages (not model messages) for better state restoration and backend integration (e.g., Langchain). ([Lars Grammel](https://x.com/lgrammel/status/1921542049821610068)) * **Gemini 2.5 Pro Turns YouTube Videos into Interactive Learning Apps** See it in action and check out [50+ free AI agent and RAG tutorials](https://github.com/Shubhamsaboo/awesome-llm-apps) ([Shubham Saboo](https://x.com/Saboo_Shubham_/status/1921210422742626449)). --- ## 💡 Prompting, Workflows & Best Practices * **Prompting Techniques for Gemini Thinking Models** - Provide step-by-step instructions and refine as needed - Use multishot prompting for deeper understanding - Define output and behavior with clear system instructions - Debug and steer by checking reasoning for inconsistencies - For long outputs, be specific in your prompt [Full thread](https://x.com/googleaidevs/status/1922033670224806082) ([Google AI Developers](https://x.com/googleaidevs/status/1922033670224806082)) * **10 Brutal Lessons from 6 Months of Vibe Coding** [Reddit post](https://www.reddit.com/r/PromptEngineering/comments/1kk1i8z/10_brutal_lessons_from_6_months_of_vibe_coding/) ([Ian Nuttall](https://x.com/iannuttall/status/1921901239526109543)) * **Org Charts as Agent Architectures** Manu Cornet's classic comic is a surprisingly apt metaphor for AI agent architectures—even the Microsoft one. ([sunil pai](https://x.com/threepointone/status/1921105337907548350)) * **Pro Tip: Add Cursor's Docs to Cursor** Get Cursor tips inside Cursor by adding its own documentation. ([Fili](https://x.com/filiksyos/status/1920887960729170203)) * **Plan & Act Modes in Cline: Context-First Agentic Coding** Cline's Plan Mode helps you and the agent gather context and co-create a strategy before any code is written. Act Mode then executes with full context for robust, maintainable code. ([Cline](https://x.com/cline/status/1920009558971580648), [Blog](https://cline.bot/blog/plan-smarter-code-faster-clines-plan-act-is-the-paradigm-for-agentic-coding)) --- ## 👨💻 Community Buzz & Quick Links * **Anthropic is Thinking About a Meta Registry** [Discussion](https://github.com/modelcontextprotocol/registry/discussions/11) ([Sam Bhagwat](https://x.com/calcsam/status/1920250600412811314)) * **OpenAI Deep Research for GitHub Repos in ChatGPT** Connect GitHub repos to ChatGPT's deep research agent for detailed, cited reports. [Example](https://chatgpt.com/s/dr_681bf67f214c81918c0e9f934cd17171) ([OpenAI Developers](https://x.com/OpenAIDevs/status/1920556386083102844)) --- ## ✨ Workshop Spotlight: Conquer the Complexity of Cursor ✨ Master practical AI development workflows in Cursor. This hands-on workshop covers Agents, multi-file analysis, effective prompting, Cursor rules, and strategies for handling AI failures. * **When:** Thursday, May 22, 2025, 9:00 AM to 2:00 PM (PDT) * **Where:** Zoom (Live Q&A included) * **Investment:** ~~$249~~ $200 (Early Bird - 20% off until May 14th at midnight!) [Read More](https://egghead.io/workshop/cursor) | [Register Now](https://buy.stripe.com/3csdSh2GTdhucTedQW) _(Team training also available)_ --- That's the scoop for this issue! The pace of change is only accelerating—new models, smarter agents, and better tools are landing every week. If you have feedback or questions, hit reply! Always happy to chat about the latest in AI dev tools. John Lindquist [egghead.io](https://egghead.io)
article
Hey Everyone 👋, John Lindquist here. Since I've been diving deep into AI tooling and workflows over the past year, I'm starting this weekly newsletter to share updates on what interests me and could be helpful to the community. The goal is to help everyone stay up-to-date with the latest in essentials tools for AI devs. I'll focus on relevant community news, model evaluations for coding, notable tools like Cursor and Windsurf, and practical workflows (including tools I build myself 😇). This week kicks off Cloudflare Developer Week with major announcements around agent/MCP services that many of us will likely use soon (I'll dig in and share my thoughts next issue). There are also lots of hints about new coding models possibly coming to Cursor (though my preference remains Gemini 2.5). Personally, I'm hoping for a Gemini Flash 2.5 variant. So let's hop into the latest! For my detailed, up-to-date workflows, check out the workshop info below. Recent egghead.io lessons about AI tooling: * **[Swarm Intelligence: Massively Parallelize Your AI Agents in Cursor](https://egghead.io/swarm-intelligence-massively-parallelize-your-ai-agents-in-cursor~g7u2g):** A workflow using `file-forge`, AI scripting, and a custom `git worktree` tool (`wt`) to launch parallel Cursor agents on different branches. * **[Build a Better Edit Tool in Cursor with Custom Agent Modes](https://egghead.io/build-a-better-edit-tool-in-cursor-with-custom-agent-modes~21rr0):** Create a focused 'edit mode' in Cursor for precise AI refactors without conversational overhead, overcoming Command-K limitations. * **[Visually Clone Websites with Gemini 2.5 Canvas for Cursor](https://egghead.io/visually-clone-websites-with-gemini-2-5-canvas-for-cursor~s5ugk):** Use Gemini 2.5 Pro's Canvas feature within Cursor to analyze and replicate website structures. --- ## Cloudflare Developer Week: Agent & Platform Updates Cloudflare announced several updates relevant to AI application development: * **Durable Objects Free Tier:** Lowers the barrier for experimenting with stateful serverless and the Agents SDK. ([Rita Kozlov](https://x.com/ritakozlov_/status/1909231625855983939)) * **MCP Enhancements:** BYO Auth (incl. [Auth0](https://x.com/auth0/status/1909307220816228354)) and Hibernation for MCP servers aim to improve agent security and efficiency. Exercise caution with MCP, but these are steps toward production viability. * **Workflows GA & autoRAG:** Orchestration tool is now GA; a new autoRAG product indicates more integrated AI solutions. * **Outerbase Acquisition:** Expect Durable Objects usability improvements following this acquisition. ([Rita Kozlov](https://x.com/ritakozlov_/status/1909232149246492887)) * **OpenNext Adapter Beta:** v1.0-beta for deploying Next.js apps on Cloudflare Pages adds caching, PPR, middleware support. ([CloudflareDev](https://x.com/CloudflareDev/status/1909598450871652398)) **Summary:** Cloudflare is actively enhancing its platform for AI/agent development, particularly reducing friction with Durable Objects and MCP. ## Llama 4 & Nemotron-Ultra Released Meta's Llama 4 models began rolling out, with initial reports of variable quality across implementations. Meta attributes this to implementation stabilization, denying training on test sets ([Ahmad Al-Dahle](https://x.com/Ahmad_Al_Dahle/status/1909302532306092107)). Nvidia subsequently released **Llama-Nemotron-Ultra** (253B parameters), derived from Llama-405B via pruning and reasoning-focused post-training. Open weights and data are available ([Oleksii Kuchaiev](https://x.com/kuchaev/status/1909444566379573646)). **Summary:** More powerful open models are available. Llama 4's initial rollout highlights the importance of stable implementations. Nemotron-Ultra adds a high-end specialized option. --- ## Quasar Alpha: Stealth Model on OpenRouter OpenRouter provides early access to "Quasar Alpha," a model with limited public details but notable claims: 1M token context, benchmarks reportedly surpassing Claude 3.7 Sonnet, and >4x faster speeds. Reports suggest strong coding performance comparable to O3 Mini/DeepSeek R1 but significantly faster ([Matthew Berman's Thread](https://x.com/TheMattBerman/status/1908286423976886371)). The originating lab remains anonymous; speculation includes GPT-5, Claude 4, or Gemini 3. **Summary:** The combination of large context, speed, and reported coding strength warrants attention for agentic workflows and large codebase analysis, despite benchmark caveats. Worth testing via OpenRouter if accessible. --- **✨ Workshop Spotlight: Conquer the Complexity of Cursor ✨** Master practical AI development workflows in Cursor. This hands-on workshop covers Agents, Ask, Custom Modes, multi-file analysis, effective prompting, Cursor rules, and strategies for handling AI failures. * **When:** **This Thursday!** April 10, 2025, 9:00 AM - 2:00 PM (PDT) * **Where:** Zoom (Live Q&A included) * **Investment:** $149 Unlock Cursor's potential and streamline your development process. ➡️ [**Read More about the Workshop**](https://egghead.io/workshop/cursor) ➡️ [**Register Now ($149)**](https://buy.stripe.com/dR67tT4P17Xa8CYfZ1) *(Team training also available)* --- ## Quick Links * **Nightwhisper Buzz:** Highly-rated coding model "Nightwhisper" (rumored Gemini 2.5 variant?) left LMSys Arena; release may be imminent. ([ʟᴇɢɪᴛ Tweet](https://x.com/legit_api/status/1908264443827351913), [AiBattle Tweet](https://x.com/AiBattle_/status/1907519430961025476)) * **AI SDK Speech-to-Text:** Vercel AI SDK added a `transcribe` function. ([AI SDK Tweet](https://x.com/aisdk/status/1909603418639155460)) * **Gemini 2.5 Pro Updates:** Supports YouTube URLs as input in AI Studio (transcribe, summarize, analyze); reported improvements reducing stop issues/displaying thinking tokens. ([Jean Gatt Tweet](https://x.com/jean__gatt/status/1909256747518226829), [Eric Zakariasson Tweet](https://x.com/ericzakariasson/status/1908619515023548880)) * **Baby Cursor Project:** Cursor's Ryo Lu is building a rapid prototyping environment for IDE ideas. ([Ryo Lu Tweet](https://x.com/ryolu_/status/1908328050154233863)) * **(Rumor) Qwen3 Soon?:** Hints suggest Alibaba's Qwen3 model release is near. ([Elaina Tweet](https://x.com/Elaina43114880/status/1909572798944841859)) --- If you have any feedback or any questions, feel free to respond to this email. Always happy to talk shop about the latest AI tools. John Lindquist [egghead.io](https://egghead.io)
lesson
In development we often want to test out features we are building but can only do so with deployed or staging applications or setting up Ngrok or Cloudflare Tunnels. UntunJS allows us to get the benefits of Cloudflare tunnels without having to go into the Cloudflare dashboard and set it up. In this quick lesson we utilize UntunJS to run our local Nextjs application in a Cloudflare Tunnel
lessonDuration 2m 36sFree
Supabase JS is an NPM package which provides a simple interface from JavaScript to our Supabase project. It allows us to query and mutate data using its Object Relational Mapping (ORM) syntax, and subscribe to realtime events. In this video, we install the Supabase JS package and create a new client using our project's URL and Anon Key. These can be found in the Supabase dashboard for our project, under `Settings > API`. We store these values as secrets in our Cloudflare account, and use them to instantiate a new Supabase client. Additionally, we write a query to select all of our articles from our Supabase instance, and send them back as the response from our Cloudflare Worker. In order to send a JSON response, we first stringify the object we get back from Supabase, and then set a `Content-Type` header to notify the browser that this will be a type of `application/json`. ## Code Snippets **Install Supabase JS** ```bash npm i @supabase/supabase-js ``` **Create a Cloudflare secret** ```bash npx wrangler secret put NAME ``` **Add a secret for SUPABASE_URL** ```bash npx wrangler secret put SUPABASE_URL ``` **Run wrangler development server** ```bash npx wrangler dev ``` **Add a secret for SUPABASE_ANON_KEY** ```bash npx wrangler secret put SUPABASE_ANON_KEY ``` **Query data from Supabase** ```javascript const { data } = await supabase.from("articles").select("*"); ``` **Send JSON response** ```javascript return new Response(JSON.stringify(data), { headers: { "Content-Type": "application/json", }, }); ``` ## Resources - [Selecting data with Supabase JS](https://supabase.com/docs/reference/javascript/select) - [Introducing Secrets and Environment Variables to Cloudflare Workers](https://blog.cloudflare.com/workers-secrets-environment/) - [Cloudflare docs for sending JSON responses](https://developers.cloudflare.com/workers/examples/return-json/)
lessonDuration 3m 42sFree
KV Storage is a read-optimized, eventually consistent cache that can be accessed from Cloudflare Workers. The interface for reading and writing is similar to `localStorage` in the browser. In this lesson, we create a `read-kv` route for reading from the KV store. This automatically gets passed any KV stores that have been bound to the Cloudflare Worker. Initially, the store is empty, so returns the value `null`. Additionally, we create a `write-kv` route to populate the store with test data. To reduce the overhead of stringifying and parsing JSON objects, we create two helper functions to easily read and write values to any KV store. Lastly, we publish a production version of our Cloudflare Worker, to confirm that writing these value locally - to our preview store - does not affect our production store. ## Code Snippets **readFrom helper function** ```javascript export const readFrom = async (cache, path) => { const data = await cache.get(path); return JSON.parse(data); }; ``` **writeTo helper function** ```javascript export const writeTo = async (cache, path, data) => { await cache.put(path, JSON.stringify(data)); }; ``` **Read KV route** ```javascript router.get("/read-kv", async (request, { ARTICLES }) => { const articles = await readFrom(ARTICLES, "/articles"); return json(articles); }); ``` **Write KV route** ```javascript router.get("/write-kv", async (request, { ARTICLES }) => { const articles = [{ title: "test3" }, { title: "test4" }]; await writeTo(ARTICLES, "/articles", articles); return json(articles); }); ``` **Publish Cloudflare Worker** ```bash npx wrangler publish ``` **Run wrangler development server** ```bash npx wrangler dev ``` ## Resources - [Wrangler CLI docs](https://developers.cloudflare.com/workers/wrangler/commands/) - [KV Storage docs](https://developers.cloudflare.com/workers/runtime-apis/kv/)
lessonDuration 1m 29sFree
KV Storage is a cache that Cloudflare makes available within our Workers. It replicates across multiple CDN nodes, making it a super performant way to cache data. In this lesson, we create a new KV store using the Wrangler CLI, and bind it to our Cloudflare worker using the `wrangler.toml` configuration file. Additionally, we create a `preview` store to use in development mode. ## Code Snippets **Create a KV Store** ```bash npx wrangler kv:namespace create "ARTICLES" ``` **Create a preview KV Store** ```bash npx wrangler kv:namespace create "ARTICLES" --preview ``` **Bind KV to Cloudflare Worker** ```toml kv_namespaces = [ { binding = "replace-with-your-kv-name", id = "replace-with-your-kv-production-id", preview_id = "replace-with-your-kv-preview-id" } ] ``` **Run wrangler development server** ```bash npx wrangler dev ``` ## Resources - [How KV works](https://developers.cloudflare.com/workers/learning/how-kv-works/) - [KV Storage docs](https://developers.cloudflare.com/workers/runtime-apis/kv/)
course
The “Edge” is where you write and store your code where your data is being produced. This allows for a quick and efficient data transfer, eliminating or severely reducing lag. Supabase is a suite of open-source tools wrapping a PostgreSQL database. It provides the building blocks of an app - database hosting, auth, file storage, real-time, and edge functions - so we can focus on what makes our app unique. Cloudflare Workers are serverless functions that run at the Edge! In this course, we will use the Wrangler CLI tool for interfacing with your Cloudflare account and creating or publishing your Workers. KV Storage is a cache that Cloudflare makes available to our Workers. It replicates across multiple CDN nodes, making it super performant to cache data. Combined, these three things give you the benefits of that reduced lag in a smooth and streamlined process. Throughout this course, Jon will teach you how to create a small blog that hits the key points of how to: - Query Supabase from Cloudflare Workers - Read and write KV Storage cache from Cloudflare Worker - Cache Supabase response at the Edge with KV storage And more!
lessonDuration 1m 34sFree
Cloudflare Workers are serverless functions that run at the Edge! 🔪 The Wrangler CLI is a tool for interfacing with your Cloudflare account, and creating or publishing your Workers. In this video, we use the Wrangler CLI to log in to our Cloudflare account and authorize the `wrangler` command to make changes on our behalf. Additionally, we create a worker and host it locally with the `npx wrangler dev` command. We then demonstrate making a GET request to our Cloudflare Worker from the browser, and confirm it is sending the correct response. By modifying the response locally, we can see that changes are reflected any time we refresh the browser. ## Code Snippets **Login to Cloudflare with Wrangler CLI** ```bash npx wrangler login ``` **Create Cloudflare Worker** ```bash npx wrangler init supabase-at-the-edge ``` **Run wrangler development server** ```bash npx wrangler dev ``` ## Resources - [Cloudflare Wrangler docs](https://developers.cloudflare.com/workers/wrangler/get-started/)
lessonDuration 1m 41sFree
The `waitUntil` function allows us to continue performing work in our Cloudflare Worker, after a response has been sent back to the client. In this lesson, we modify the `revalidate` route to send a response immediately, and then continue on to fetch new data and refresh our KV store. Finally, we use the Thunder Client extension to simulate a POST request to the `revalidate` route, and confirm that this receives a response before the cache is updated. ## Code Snippets **Update Revalidate route to respond immediately** ```javascript router.post( "/revalidate", withContent, async (request, { SUPABASE_URL, SUPABASE_ANON_KEY, ARTICLES }, context) => { const updateCache = async () => { const { type, record, old_record } = request.content; const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY); if (type === "INSERT" || type === "UPDATE") { await writeTo(ARTICLES, `/articles/${record.id}`, record); } if (type === "DELETE") { await ARTICLES.delete(`/articles/${old_record.id}`); } const { data: articles } = await supabase.from("articles").select("*"); await writeTo(ARTICLES, "/articles", articles); console.log("updated cache"); }; context.waitUntil(updateCache()); console.log("sending response"); return json({ received: true }); } ); ``` **Run wrangler development server** ```bash npx wrangler dev ``` ## Resources - [Cloudflare waitUntil docs](https://developers.cloudflare.com/workers/runtime-apis/scheduled-event/) - [Supabase.js docs](https://github.com/supabase/supabase-js) - [Wrangler CLI docs](https://developers.cloudflare.com/workers/wrangler/commands/) - [KV Storage docs](https://developers.cloudflare.com/workers/runtime-apis/kv/) - [Thunder Client VS Code extension](https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client)
lessonDuration 2m 34s
Creating a new workers project using Wrangler is pretty easy. We first will install and double-check that we have Wrangler installed. Then we will connect Wrangler to our cloudflare project. Lastly, using the terminal, we can easily create our new Wrangler project.
lessonDuration 1m 5sFree
We recently made more specific location personalization features available to all users on Cloudflare Workers. Previously only available to Enterprise users, these new features will allow us to give more detailed information in our example project, such as the city the user is visiting from.
course
Cloudflare Workers let you write JavaScript Service Workers that run directly in Cloudflare's 200+ edge locations around the world. With a Cloudflare Worker, you can modify your site's HTTP requests and responses, make parallel requests, and even reply directly from the edge. Cloudflare Workers are written against a similar API to the W3C Service Workers standard. However, while Service Workers run inside the end user's browser, Cloudflare Workers run on Cloudflare's servers. This means that Cloudflare Workers can implement trusted code (which the client cannot tamper with), and will work no matter what browser the user is running. In this course, Kristian Freeman will teach you how to build and deploy a Serverless API with Cloudflare Workers. By learning how to build your own serverless JSON APIs, you can effectively manage a highly-available backend for your projects, without needing to learn DevOps or manage services.
lessonDuration 1m 22sFree
In this course, Kristian Freeman will teach you how to build and deploy a Serverless API with Cloudflare Workers. By learning how to build your own serverless JSON APIs, you can effectively manage a highly-available backend for your projects, without needing to learn DevOps or manage services.
lessonDuration 3m 28sFree
Cloudflare Pages is a JAMstack platform for frontend developers to collaborate and deploy websites. Cloudflare Pages is currently in open beta. In this lesson, we'll publish our frontend UI using Cloudflare Pages, Cloudflare's static site deployment tool.
lessonDuration 6m 12sFree
In this lesson, we'll parse the incoming data from Unsplash's API and transform it for our frontend client. Because Cloudflare Workers is serving as "middleware" - in-between the Unsplash API and our frontend client we'll build shortly - we can use it to format or simplify data coming through it that our client doesn't care about. We'll also use the Response class to return a JSON response from our API. JSON responses need to be formatted in a specific way to be able to be parsed by clients, so we'll look at the various pieces of a Response (body and headers) and how they work together to represent a JSON response.
lessonDuration 2m 36sFree
In this lesson, we'll install Wrangler, the Workers command-line tool. We'll then create a new Cloudflare Workers project using Wrangler, configure it, and then publish it.
course
Cloudflare Workers is a serverless application platform that enables you to create and deploy functions to Cloudflare's Edge Network. Unlike other serverless providers that only have regional data centers, Cloudflare's Edge Network consists of hundreds of servers all over the world. Cloudflare Workers is a powerful platform, and this course serves as a great introduction for what it can do. Follow along with Kristian Freeman as you build a localization engine that renders data based on the Edge location nearest to the application's user. After this course, you'll be ready to start experimenting with your own Cloudflare Workers projects. *Need an idea?* *[Check out the suggested Portfolio Project for this course.](https://egghead.io/projects/introduction-to-cloudflare-workers)*
lessonDuration 5m 39sFree
We'll take a look at the default code in `index.js` in a Workers project. We'll take a second to understand how it works before building the rest of our project. First will see what our Worker looks like in an actual browser by running `wrangler preview`. In a terminal, and we'll check out how Serverless functions in Cloudflare Workers listen for HTTPS requests via the "fetch" event and respond to them by creating and returning a new Response.
lessonDuration 2m 56sFree
Wranglers generate command, `wrangler generate`, allows you to create new Cloudflare Workers projects. Using the URL parameter, you can also generate new projects based on Cloudflare's starter templates, or open-source projects created by other developers, but for now, you will just use the default. To do this you'll only need to give it a name, for example, `wrangler generate my-worker`, this will create a new project called my-worker.
lessonDuration 1m 57sFree
Using NPM, you can install Cloudflare Workers' CLI (command-line interface), Wrangler, by typing `npm install -g @cloudflare/wrangler` into your command line. Wrangler allows you to generate and publish Cloudflare Workers projects. We'll also use the `wrangler login` command which will give you a link to authorize Wrangler. This will set up an API token specifically for your Wrangler installation that will allow you to publish and read all the Workers and Workers KV information that you need.
lessonDuration 1m 41sFree
To deploy a Cloudflare Workers serverless function, you'll need to sign up for a free Cloudflare Workers account at [workers.cloudflare.com](http://workers.cloudflare.com/), and select your unique workers.dev subdomain to deploy your functions to.
lessonDuration 6m 22sFree
Up until now, we've been rendering plain responses, not based on any information coming in with a request. The request.cf object sent with every incoming HTTP request to a Workers function has a ton of interesting information, including the regionality of the request, and which Cloudflare data center is responding to the request. Using this information, we'll render a dynamic HTML page based on where the user visiting our site is in the world.
lessonDuration 5m 3sFree
By updating the response body and setting a corresponding Content-Type header, we can render HTML pages from directly inside of our Cloudflare Workers function. We will update our Cloudflare Worker to return a call to a template function that we define. That template function returns a string of HTML that we will render in the browser.