Skip to content
Back to Templates

Rust Hello World

Simple Rust serverless functions demonstrating basic HTTP handling and performance benchmarks.

rust-template

Rust Hello World

This example demonstrates how to create Rust serverless functions on Vercel with multiple endpoints showcasing different capabilities.

Demo

https://rust-hello-world.vercel.app

Project Structure

  • api/hello - Basic handler with json response
  • api/streaming - Streaming response example
  • api/realistic-math-bench - Mathematical benchmark
  • api/slower-bench - Performance benchmark
  • Cargo.toml - Rust dependencies and multiple binary configurations

Deploy

Deploy the example using Vercel:

Development

Clone the repository:

git clone https://github.com/vercel/examples.git
cd 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
GitHub Repovercel/examples
Use Cases
Stack