This is a simple Rust Wasm example that converts an incoming HTTP request to a JSON representation, and returns that as the response.
cargo
>=1.75wash
>=0.27.0wasmtime
>=19.0.0 (if running with wasmtime)
wash build
You must have wasmtime >=19.0.0 for this to work. Make sure to follow the build step above first.
wasmtime serve -Scommon ./build/http_hello_world_s.wasm
Ensuring you've built your component with wash build
, you can launch wasmCloud and deploy the full hello world application with the following commands.
Once the application reports as Deployed in the application list, you can use curl
to send a request to the running HTTP server.
wash up -d
wash app deploy ./wadm.yaml
wash app list
curl http://127.0.0.1:8080
To learn how to extend this example with additional capabilities, see the Adding Capabilities section of the wasmCloud documentation.