- ..
- src
- .gitignore26 B
- Cargo.toml239 B
- README.md982 B
- wrangler.jsonc322 B
README.md
wasm
A Durable Object counter in Rust, compiled to Wasm with workers-rs.
worker-build is the workers-rs build tool. It compiles the crate to
wasm32-unknown-unknown, runs wasm-bindgen over the output, and
writes the JavaScript entry point (build/worker/shim.mjs) that
wrangler.jsonc names as main — you do not write any JavaScript
yourself. Install it once, build, and deploy:
rustup target add wasm32-unknown-unknown
cargo install worker-build
worker-build --release
celld deploy . --bucket s3://my-cells-bucket
curl http://localhost:8080/c/hello # {"lang":"rust","n":1,"name":"hello"}
curl http://localhost:8080/c/hello # n increments — state lives in the cell
curl http://localhost:8080/c/other # a different cell, its own counter
See the WebAssembly docs for how celld ships and
runs the .wasm module. Contributed by
Connor Hindley.