Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 771 Bytes

README.md

File metadata and controls

33 lines (22 loc) · 771 Bytes

HTTP server example

Quickstart with Docker

With an WASI-enabled Docker, you just need one line of command to build and run the HTTP server example. For details, refer to the Dockerfile and docker-compose.yml files.

docker compose build
docker compose run --no-TTY -p 8080:8080 server

Next, you can jump directly to the Test section. If you want to build and run the application step by step on your own system, read on.

Build

cargo build --target wasm32-wasi --release

Run

wasmedge target/wasm32-wasi/release/wasmedge_hyper_server.wasm

Test

Run the following from another terminal.

$ curl http://localhost:8080/echo -X POST -d "WasmEdge"
WasmEdge