
Wrangler Has a Free CLI API That Deploys Code to Cloudflare in Seconds
Wrangler is Cloudflare's CLI for Workers, Pages, R2, D1, KV, and Queues. Deploy globally in seconds from your terminal. Quick Start # Create a new project npm create cloudflare@latest my-worker # Dev mode with hot reload wrangler dev # Deploy globally wrangler deploy wrangler.toml: Configuration name = "my-scraper-api" main = "src/index.ts" compatibility_date = "2026-03-01" # Environment variables [vars] API_VERSION = "v2" MAX_RESULTS = "100" # Secrets (set via CLI) # wrangler secret put API_KEY # D1 Database [[d1_databases]] binding = "DB" database_name = "scraping-db" database_id = "xxxx-xxxx-xxxx" # R2 Storage [[r2_buckets]] binding = "BUCKET" bucket_name = "scraped-data" # KV Namespace [[kv_namespaces]] binding = "CACHE" id = "xxxx" # Cron Triggers [triggers] crons = [ "*/30 * * * *" ] # Routes routes = [ { pattern = "api.example.com/*" , zone_name = "example.com" } ] D1 Commands # Create database wrangler d1 create scraping-db # Run SQL wrangler d1 execute scraping-db --command "C
Continue reading on Dev.to JavaScript
Opens in a new tab



