Cloudflare Docs
Workers
Visit Workers on GitHub
Set theme to dark (⇧+D)

Getting started with 🤠 Wrangler

wrangler is a command line tool for building Cloudflare Workers.

Quick Start

# Make a javascript file
$ echo "export default { fetch() { return new Response('hello world') } }" > index.js
# try it out
$ npx wrangler@beta dev index.js
# and then publish it
$ npx wrangler@beta publish index.js --name my-worker
# visit https://my-worker.<your workers subdomain>.workers.dev

Installation:

$ npm install wrangler@beta