![rust-wcgi-starter package icon](/_next/image?url=https%3A%2F%2Fcdn.wasmer.io%2FCACHE%2Fimages%2Ficon%2Fpackage%2F5591ccba-25ef-4505-bc83-e42a77479508_default_icon%2F789846dc310f461712488637d2e4844d.png&w=96&q=75)
wasmer-examples/rust-wcgi-starter
wasi
Public
wasmer run wasmer-examples/rust-wcgi-starter
wasmer run wasmer-examples/rust-wcgi-starter
This is a template project for creating a WCGI package that can be published to the Wasmer Registry.
Getting Started
First, make sure you have Rust and its wasm32-wasi
target installed.
rustup target add wasm32-wasi
Now, you can compile the project to WebAssembly.
$ cargo build --target=wasm32-wasi --release
Finished release [optimized] target(s) in 0.00s
$ ls target/wasm32-wasi/release
build deps examples incremental wcgi-rust-template.d wcgi-rust-template.wasm
You can also use wasmer run
to run the WCGI server locally.
$ wasmer run . --net
INFO run: wasmer_wasix::runners::wcgi::runner: Starting the server address=127.0.0.1:8000 command_name="server"
[!NOTE] You can also run
wasmer run wasmer-examples/rust-wcgi-starter --net
to run the remote package
Deploy on Wasmer Edge
The easiest way to deploy your WCGI Rust app is to use the Wasmer Edge.
Live example: https://wcgi-rust-starter.wasmer.app/
wasmer deploy
[!NOTE] You will need to change the namespace in
wasmer.toml
to your own namespace and app name inapp.yaml
to your own app name.