This lab illustrates how WASM can be used to serve as an output binding in Dapr. In this lab, we need a simple "Hello World!"
Rust application which we will register as a binding. Whenever the binding gets executed, the application will print "Hello World!"
or, in our case, "Hello binding!"
.
How to complete this lab:
- Build the
dapr-wasm-binding
applicationcd dapr-wasm-binding
cargo build --target wasm32-wasi --release
cd ..
- Start Dapr using
dapr init
- Start a dapr sidecar and register the binding and
dapr run --app-id wasm --dapr-http-port 3000 --resources-path components
- Execute the binding
curl -X POST http://localhost:3000/v1.0/bindings/wasm -d'{"operation": "execute"}'
- Expected output:
Hello, binding!
- Expected output: