Skip to content

Commit eb2a536

Browse files
committed
refactor(web-kv): reorganize and add README.md
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 5774e2a commit eb2a536

5 files changed

Lines changed: 55 additions & 32 deletions

File tree

Cargo.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/web/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# `wasi-keyvalue` in the Web
2+
3+
This example shows a Web app using `wasi:keyvalue` implementation provided by the server via WebTransport using wRPC.
4+
5+
The server acts as both a direct implementor of `wasi:keyvalue` and a "proxy", which can delegate `wasi:keyvalue` calls issued by the Web client to other `wasi:keyvalue` implementations via various transports supported by wRPC.
6+
7+
## Runing
8+
9+
With `cargo`:
10+
11+
```
12+
cargo run -p wasi-keyvalue-web
13+
```
14+
15+
## `wasi-keyvalue` plugins
16+
17+
To invoke other wRPC `wasi:keyvalue` plugins in "proxy" mode, for example TCP, try:
18+
19+
```
20+
cargo run -p wasi-keyvalue-tcp-server
21+
```
22+
23+
And select `wRPC/TCP` as the protocol in the UI

examples/web/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "web-rust-keyvalue"
2+
name = "wasi-keyvalue-web"
33
version = "0.1.0"
44

55
authors.workspace = true

examples/web/rust/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ async fn main() -> anyhow::Result<()> {
677677
.context("failed to query WebTransport socket address")?;
678678
let port = ep_addr.port();
679679

680-
let index = get(Html(include_str!("../index.html")));
680+
let index = get(Html(include_str!("../../ui/index.html")));
681681
let http = axum::serve(
682682
lis,
683683
Router::new()

0 commit comments

Comments
 (0)