These examples provide an easy way to get started with Wagi.
cache.toml
illustrates using the caching features of Wagihello.wasm
andhello.wat
provide simple WebAssembly modules for testinghttp-example.wasm
provides a simple example of our HTTP client library support for Wagi modulesinvoice.toml
andmkbindle.rs
are for loading these testing modules into a Bindle servermodules.toml
is for loading the modules into Wagi straight off of the diskerror.wat
shows an example of sending an HTTP error.
If you have Wagi compiled, you can use wagi -c examples/modules.toml
to start up a Wagi
server using modules.toml
.
Take a look at the Makefile
and make serve
for an example.
If you already have a Bindle server, you can load the examples into a Bindle server:
$ cargo run --example mkbindle
$ wagi -b example.com/hello/1.3.3
If your Bindle server isn't running at "http:https://localhost:8080/v1",
you can use the BINDLE_URL
environment variable or the --bindle-url
argument
to Wagi.
Take a look at the Makefile
and make run-bindle
for more examples.
If you would like to turn on caching, take a look at cache.toml
.
You will need to set some paths.