Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Sample HTTP incrementor

Sample component that exposes wasi:http incrementing a counter based on the http path.

Compose with the valkey-client:

wac plug sample-http-incrementor.wasm --plug valkey-client.wasm -o valkey-http-incrementor.wasm

Start a Valkey server:

docker run --rm -p 6379:6379 valkey/valkey:8

Start the incrementor:

wasmtime serve -Sconfig -Sinherit-network -Sallow-ip-name-lookup -Scli valkey-http-incrementor.wasm

Increment all the things:

curl http://localhost:8080/hello
1
curl http://localhost:8080/hello
2