Imagine deploying a full backend in under a minute, with zero servers, zero maintenance, and global speed — all for free.
What Are Cloudflare Workers?
Cloudflare Workers are **serverless functions** that run JavaScript (or Rust/WebAssembly) on Cloudflare’s global edge — not on a distant VPS. They intercept HTTP requests before they hit your origin, letting you modify responses, route traffic, call APIs, or serve dynamic content — all in under 10ms worldwide. No cold starts, no scaling worries, and **100% free up to 100,000 requests/day**.
- Use Cases: URL shorteners, auth, A/B tests, API gateways, JSON APIs.
- Free Tier: 100K req/day, 10ms CPU each — enough for most hobby projects.
Install Wrangler CLI (Takes 1 Minute)
- Open your computer’s Terminal (Mac/Linux) or Command Prompt / PowerShell (Windows).
- Paste this command and press Enter:
npm create cloudflare@latest
- Wait 10–20 seconds — it downloads the tool.
- You’ll see prompts:
Project name?→ Type:hello-world→ press EnterSelect a template:→ ChooseHello World Worker→ press EnterInstall dependencies?→ Typey→ press Enter
- Done! A folder called
hello-worldis created with everything ready.
Edit the Code (No Experience Needed)
- Open the
hello-worldfolder in any code editor:- Free: VS Code (recommended)
- Or use Notepad (Windows) / TextEdit (Mac)
- Inside the folder, open the file:
src/index.js - Delete everything and paste this simple code:
export default {
async fetch(request) {
return new Response("Hello from Cloudflare Workers! 🚀", {
headers: { "content-type": "text/plain" },
});
}
}; - Save the file (Ctrl+S or Cmd+S).
Deploy — Go Live in 10 Seconds
- Back in your Terminal, make sure you’re inside the
hello-worldfolder:cd hello-world - Paste this command and press Enter:
npm run deploy
- Wait 5–10 seconds. You’ll see:
Deployed to: https://hello-world.yourname.workers.dev
Published! - Copy the URL → open in browser → see your message live!
Next: Test & Share
Send the URL to a friend in another country — they’ll see it load instantly. That’s the power of the **edge**.
Want to return JSON? Change "text/plain" to "application/json" and return:
Cloudflare Workers are the future of lightweight backends — no servers, no DevOps, just code that runs everywhere. A single Worker can power a URL shortener, protect a form with CAPTCHA, redirect old links, or serve personalized JSON — all from the same infrastructure that powers 20% of the internet. The free tier isn’t a trial: **100,000 requests/day is real usage**, enough for a blog API, webtools quote generator, or travel tracker. And when you grow? It scales to millions without changing a line. Pair with **Workers KV** (free 1GB storage) or **D1** (SQLite at the edge) for full apps. For learners and indie makers, Workers remove the biggest barrier to building: infrastructure. You write JS, hit deploy, and it just works — globally, instantly, freely.
Full disclosure: I haven’t used Workers in production yet. I know it lets you run JavaScript at the edge with zero servers (100k free requests/day), and I’ve seen people build APIs, redirects, and A/B tests with it — but I’m still learning. Once I need dynamic features without a backend, Workers will be my first choice because it’s free and crazy fast. For now, I stick to static pages — but I’m excited to try it soon!