Handler
Create a new library crate or project, then write the handler for the chosen language.- Modern Rust
- Legacy Rust
- JavaScript
Create a library crate and replace Replace
Cargo.toml:src/lib.rs:Client::new() routes requests through the WASI outbound-http interface — the host runtime handles the actual network call. The await on client.send() is real async: the handler yields while the upstream request is in flight. The response body arrives as a stream; body.contents().await reads it fully into memory before parsing. Every ? propagates errors through anyhow::Result — FastEdge converts a handler returning Err into a 500 response, with the error message written to application logs.Build
Compile the handler to a WebAssembly binary.- Modern Rust
- Legacy Rust
- JavaScript
./target/wasm32-wasip2/release/outbound_fetch.wasm.