
This example demonstrates how to create Rust serverless functions on Vercel with multiple endpoints showcasing different capabilities.
https://rust-hello-world.vercel.app
api/hello - Basic handler with json responseapi/streaming - Streaming response exampleapi/realistic-math-bench - Mathematical benchmarkapi/slower-bench - Performance benchmarkCargo.toml - Rust dependencies and multiple binary configurationsDeploy the example using Vercel:
Clone the repository:
git clone https://github.com/vercel/examples.gitcd examples/rust/hello-world
Install Rust if you haven't already:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Test locally (requires Rust toolchain):
vc dev