backVolver a las plantillas

Rust WCGI

A simple Rust WCGI program running on the Edge

preview of Rust WCGI

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 --netto 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 in app.yaml to your own app name.

Rust WCGI · Wasmer