Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Project Templates

Cloudflare Workers Template

Files included:

  • wrangler.jsonc: Wrangler configuration
  • package.json: Node.js dependencies (for Wrangler)
  • src/index.js: JavaScript entry point
  • wasm-app/: Rust WASM module source

Build with:

cd wasm-app
cargo build --target wasm32-unknown-unknown --release

Run locally:

npx wrangler dev

Deploy:

npx wrangler deploy

Fastly Compute Template

Files included:

  • fastly.toml: Fastly service configuration
  • Cargo.toml: Rust project configuration
  • src/main.rs: Application entry point
  • src/lib.rs: WASM module

Build with:

cargo build --target wasm32-wasi --release

Run locally:

fastly compute serve

Deploy:

fastly compute deploy

Spin Template

Files included:

  • spin.toml: Spin application manifesthown
  • Cargo.toml: Rust project configuration
  • src/lib.rs: Application entry point

Build with:

spin build

Run locally:

spin up

Deploy:

spin deploy

Cloud Run Template

Files included:

  • Dockerfile: Container image definition
  • Cargo.toml: Rust project configuration
  • src/main.rs: HTTP server entry point
  • src/uzumibi.rs: Uzumibi integration

Build with:

cargo build --release

Run locally:

cargo run

Deploy:

gcloud builds submit --tag gcr.io/PROJECT_ID/app
gcloud run deploy --image gcr.io/PROJECT_ID/app