Skip to content

Commit

Permalink
Merge pull request #27 from wacker-dev/examples
Browse files Browse the repository at this point in the history
examples: use the wasm32-wasip2 target
  • Loading branch information
iawia002 authored Oct 21, 2024
2 parents 5982bb8 + c8fcfcb commit f8b8ebc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions examples/client/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "wasm32-wasip2"
3 changes: 2 additions & 1 deletion examples/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
name = "http-client"
version = "0.0.0"
edition = "2021"
rust-version = "1.82"
publish = false

[dependencies]
waki = { version = "0.3.1", features = ["json", "multipart"] }
waki = { version = "0.4.0", features = ["json", "multipart"] }
serde = { version = "1.0.202", features = ["derive"] }

# reduce wasm binary size
Expand Down
10 changes: 5 additions & 5 deletions examples/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ with the [waki](https://github.com/wacker-dev/waki) library.

## Build

First, install [cargo component](https://github.com/bytecodealliance/cargo-component):
Requires Rust 1.82+.

```
cargo install cargo-component@0.15.0
$ rustup target add wasm32-wasip2
```

Then execute the following command to compile it into a WASM program:
Use the following command to compile it into a WASM program:

```
$ cargo component build
$ cargo build
```

Or use `--release` option to build it in release mode:

```
$ cargo component build --release
$ cargo build --release
```

## Run
Expand Down
2 changes: 2 additions & 0 deletions examples/server/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "wasm32-wasip2"
3 changes: 2 additions & 1 deletion examples/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "http-server"
version = "0.1.0"
edition = "2021"
rust-version = "1.82"
publish = false

[lib]
Expand All @@ -11,7 +12,7 @@ crate-type = ["cdylib"]
proxy = true

[dependencies]
waki = "0.3.1"
waki = "0.4.0"

# reduce wasm binary size
[profile.release]
Expand Down
10 changes: 5 additions & 5 deletions examples/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ with the [waki](https://github.com/wacker-dev/waki) library.

## Build

First, install [cargo component](https://github.com/bytecodealliance/cargo-component):
Requires Rust 1.82+.

```
cargo install cargo-component@0.15.0
$ rustup target add wasm32-wasip2
```

Then execute the following command to compile it into a WASM program:
Use the following command to compile it into a WASM program:

```
$ cargo component build
$ cargo build
```

Or use `--release` option to build it in release mode:

```
$ cargo component build --release
$ cargo build --release
```

## Run
Expand Down

0 comments on commit f8b8ebc

Please sign in to comment.