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
- shortscale
- wasm-bindgen for communicating between WebAssembly and JavaScript
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
, andcfg-if
- Updated version of
wasm-bindgen
- Filled in
description
,license
, andrepository
inCargo.toml
- Added
Cargo.lock
to.gitignore
- Rewrote the README