Command Palette

Search for a command to run...

leoguo-dev/whatsapp-webhook
Public
wasmer run leoguo-dev/whatsapp-webhook

AXUM WASIX STARTER

This repo contains a starter project for building a Wasix based axum web server.

Prerequisites

Install and pin the following versions for local wasmer run and Edge deploy to match:

ComponentVersion
Wasmer CLI7.2.0-alpha.3 or newer stable with equivalent WASIX
cargo-wasix0.1.26+ (cargo install -f cargo-wasix)
wasix-org/rust toolchainv2025-03-17.2 (see below)

Application dependencies

CrateVersionNotes
axum0.6.9Pinned: 0.6.10+ needs tokio ^1.25; WASIX fork is wasix-1.24.2
tokio1.24.2Patched via wasix-org/tokio (wasix-1.24.2)
serde1.0.x (lock: 1.0.228)crates.io; safe to cargo update -p serde
tracing0.1.x (lock: 0.1.44)crates.io
tracing-subscriber0.3.x (lock: 0.3.23)crates.io

Pin the WASIX Rust toolchain

cargo wasix downloads the latest toolchain by default. Newer tags (e.g. v2025-11-07.1+rust-1.90) emit wasix_32v1.ws_connect imports that Wasmer 7.2.x does not implement yet, which breaks local runs.

Use the newest tested tag without those imports:

cargo wasix download-toolchain v2025-03-17.2

Do not run bare cargo wasix download-toolchain unless you intend to move to a newer tag and re-verify with wasmer inspect (no ws_connect / http_request imports).

Install Wasmer 7.2.0-alpha.3 (Linux x86_64 example)

curl -fsSL -o /tmp/wasmer.tar.gz \
  https://github.com/wasmerio/wasmer/releases/download/v7.2.0-alpha.3/wasmer-linux-amd64.tar.gz
tar -xzf /tmp/wasmer.tar.gz -C /tmp
cp /tmp/bin/wasmer ~/.wasmer/bin/wasmer
wasmer --version

Compiling the project

cargo wasix build --release

Cargo.lock pins mio to wasix#a4662d9 for wasix crate Errno compatibility. After cargo update, confirm that revision is still present.

cargo wasix may warn that hyper should be patched; this project uses crates.io hyper 0.14.27 with the wasix-1.24.2 tokio fork. Adding a [patch.crates-io] hyper entry causes cargo-wasix to resolve tokio epoll, which breaks the build.

Running the project

PORT=8080 wasmer run target/wasm32-wasmer-wasi/release/whatsapp-webhook.wasm --net
curl http://127.0.0.1:8080/

Note: Set PORT when running locally (e.g. 8080). On Wasmer Edge the platform typically expects port 80.

Deploy to Wasmer Edge

  1. Login to wasmer-cli:
wasmer login
  1. Set your namespace in wasmer.toml and app.yaml (owner field).
  2. Build and deploy:
cargo wasix build --release
wasmer deploy

app.yaml uses package: . to deploy the local package built from wasmer.toml.

Checkout the full tutorial here and the Wasmer Rust HTTP guide.

Troubleshooting

  • ws_connect unknown import: WASIX toolchain is too new for your Wasmer CLI. Run cargo wasix download-toolchain v2025-03-17.2 and rebuild.
  • wasix::Errno / wasix::wasi::Errno compile error in mio: ensure Cargo.lock has mio at git rev a4662d9669d850bf430192c3e2fbd21e4753cec8.
  • libc = "=0.2.139" resolution failed: keep libc pinned by rev in Cargo.toml (4c0c6c29378b68c4af7f0b1384a111ba3081b6bf); avoid cargo update without --locked unless you know the graph still resolves.

Description for package whatsapp-webhook

leoguo-dev/whatsapp-webhook: Description for package whatsapp-webhook