You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
In our blog series `Part 1 </news/2024/wasm-component-model-part-1/>`__ and `2 </news/2024/wasm-component-model-part-2/>`__ we have covered the core mechanism of the
8
-
WebAssembly Component Model and show cased how to create a Wasm Component using WASI 0.2 APIs and the **wasi/http:proxy** world.
7
+
In our blog series `Part 1 </news/2024/wasm-component-model-part-1/>`__ and `2 </news/2024/wasm-component-model-part-2/>`__ , we have covered the core mechanism of the WebAssembly Component Model and showcased how to create a Wasm Component using WASI 0.2 APIs and the **wasi/http:proxy** world.
9
8
10
9
In this blog post, we will have a look on the `Fermyon's Spin <https://www.fermyon.com/spin>`__ SDK for `Rust <https://fermyon.github.io/rust-docs/spin/main/spin_sdk/index.html>`__ and create a component that can be hosted on NGINX Unit.
11
10
12
-
The Spin SDK for Rust comes with a great developer experience as it wraps a lot of the manual work in an easy to consume Rust API.
11
+
The Spin SDK for Rust provides a great developer experience, as it wraps a lot of the manual work in an easy to consume Rust API.
13
12
14
13
Let's start by creating a new Rust library using **cargo new**. This will create a new library project in a sub-directory **test-spin-component** of our current work directory.
15
14
@@ -19,14 +18,13 @@ Let's start by creating a new Rust library using **cargo new**. This will create
19
18
$ cargo new --lib test-spin-component
20
19
$ cd test-spin-component
21
20
22
-
Add the latest version of the "spin-sdk" and "anyhow" (Flexible Error Types and a dependency of the Spin SDK) crates to the project by issuing:
21
+
Add the latest version of the "spin-sdk" and "anyhow" (Flexible Error Types and a dependency of the Spin SDK) crates to the project by running the following command:
23
22
24
23
.. code-block:: bash
25
24
26
25
$ cargo add spin-sdk anyhow
27
26
28
-
Before we implement the actual functionality, we must modify our **Cargo.toml** file. Open the **Cargo.toml** with an editor of your
29
-
choice and append the following to the bottom of your existing **Cargo.toml** file.
27
+
Before we implement the actual functionality, we must modify our **Cargo.toml** file. Open the **Cargo.toml** with an editor of your choice and append the following to the bottom of your existing **Cargo.toml** file.
30
28
31
29
.. code-block:: toml
32
30
@@ -64,7 +62,7 @@ Compile the Rust Library into a Wasm Component using **cargo component**:
64
62
65
63
$ cargo component build --release
66
64
67
-
To run the Wasm Component on NGINX Unit, startup Unit and use this initial configuration.
65
+
To run the Wasm Component on NGINX Unit, start up Unit and use this initial configuration.
68
66
69
67
.. note:: Make sure you point to the Wasm component by using an absolute path.
70
68
@@ -84,5 +82,4 @@ To run the Wasm Component on NGINX Unit, startup Unit and use this initial confi
84
82
}
85
83
}
86
84
87
-
As the Wasm Component we have just crated uses the request and response interfaces defined by the **wasi:http/proxy**
88
-
it can easily be deployed on NGINX Unit.
85
+
As the Wasm Component we have just created uses the request and response interfaces defined by the **wasi:http/proxy**, it can easily be deployed on NGINX Unit.
0 commit comments