/wasm-worker

Primary LanguageJavaScriptOtherNOASSERTION

wasm-worker

Demo project to accompany the blogpost Calling Rust from a Cloudflare Worker.

Required tools

Configure and build

Login to your Cloudflare account, and edit wrangler.toml to set your own account_id. Values for zone_id and route are only needed if you want to deploy on your own domain.

Build and run locally

wrangler dev

Build and publish to cloudflare

wrangler publish

Dependencies

Template

This repo was originally created using wrangler generate wasm-worker -t rust which copied rustwasm-worker-template.

  • Removed unused files: .appveyor.yml, .travis.yml, .cargo-ok
  • Removed worker/metadata_wasm.json - no longer used by wrangler
  • Removed optional libraries console_error_panic_hook, wee_alloc, and cfg-if
  • Updated version of wasm-bindgen
  • Filled in description, license, and repository in Cargo.toml
  • Added Cargo.lock to .gitignore
  • Rewrote the README