
This example shows how to deploy a Rust web application using the Axum framework on Vercel with streaming capabilities.
api/axum.rs - Main Axum application
/ - Entrypoint with an interactive HTML interface for streaming/stream - Streaming endpoint/users - Post request endpointCargo.toml - Rust dependencies and binary configurationvercel.json - Vercel deployment configurationDeploy the example using Vercel:
Clone the repository:
git clone https://github.com/vercel/examples.gitcd examples/rust/axum
Install Rust if you haven't already:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Test locally:
vc dev