Build
Deploy your first Worker
Start with a minimal Worker and verify AI-generated edge code, development commands, and response output.
Edited and verified by Orange Book Editorial Team ·
Outcome
Run a Worker locally and verify it with a real response instead of trusting an AI claim that deployment succeeded.
Prerequisites
- Node.js 20.0 or newer
- A Cloudflare account
- A terminal you can run commands in
Create the project
npm create cloudflare@latest -- first-workerChoose a Worker template in the prompt, then enter the generated directory.
Return a minimal response
export default {
async fetch() {
return Response.json({ ok: true, message: 'hello from the edge' });
},
};Verify locally
npm run devOpen the local URL printed by the command. Expected output:
{"ok":true,"message":"hello from the edge"}Review AI-generated code
- Does it use the current Worker module syntax instead of the legacy Service Worker listener style?
- Did it put a secret in source code or version control?
- Can you find every Wrangler field in the current configuration reference?
- Does the local response match the expected output above?
Primary sources
Did this page help you complete your goal?
Beta feedback is generated in this browser and is never uploaded automatically.