sdk-rust/example-projects/wasi-example
Anton Whalley 2f57c3ce36
WASI example (#228)
* feat: wasi-example

Signed-off-by: Anton Whalley <anton@venshare.com>

* fix: remove line end

Signed-off-by: Anton Whalley <anton@venshare.com>

---------

Signed-off-by: Anton Whalley <anton@venshare.com>
2024-05-10 15:06:08 +02:00
..
src WASI example (#228) 2024-05-10 15:06:08 +02:00
Cargo.toml WASI example (#228) 2024-05-10 15:06:08 +02:00
README.md WASI example (#228) 2024-05-10 15:06:08 +02:00

README.md

Install WASMEdge:

https://wasmedge.org/docs/start/install/

To run the server:

cargo run --target wasm32-wasi

To test a GET:

curl -sw '%{http_code}\n' http://localhost:9000/health/readiness

To test a POST:

curl -d '{"name": "wasi-womble"}' \
  -H'content-type: application/json' \
  -H'ce-specversion: 1.0' \
  -H'ce-id: 1' \
  -H'ce-source: http://cloudevents.io' \
  -H'ce-type: dev.knative.example' \
  http://localhost:9000