From 656c03609a2ba480dc88b28ade288b33a4b3a26b Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 29 Aug 2023 17:01:29 +0100 Subject: examples/rust: Add a minimal hello world rust example This is about the smallest it can be. Its Unit application config would look like "applications": { "rust-hello-world": { "type": "wasm", "module": "/path/to/unit-wasm/examples/rust/hello-world/target/wasm32-wasi/debug/rust_hello_world.wasm", "request_handler": "uwr_request_handler", "malloc_handler": "luw_malloc_handler", "free_handler": "luw_free_handler" } } Signed-off-by: Andrew Clayton --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index ad62698..c6194d2 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,14 @@ Create the following Unit config "action": { "pass": "applications/rust-upload-reflector" } + }, + { + "match": { + "uri": "/hello-world*" + }, + "action": { + "pass": "applications/rust-hello-world" + } } ], @@ -344,6 +352,13 @@ Create the following Unit config "free_handler": "luw_free_handler", "request_end_handler": "uwr_request_end_handler", "response_end_handler": "uwr_response_end_handler" + }, + "rust-hello-world": { + "type": "wasm", + "module": "/path/to/unit-wasm/examples/rust/hello-world/target/wasm32-wasi/debug/rust_hello_world.wasm", + "request_handler": "uwr_request_handler", + "malloc_handler": "luw_malloc_handler", + "free_handler": "luw_free_handler" } } } -- cgit