Skip to content
Back to Templates

Rust Axum

A Rust web application using the Axum framework with streaming capabilities on Vercel.

rust-template

Rust Axum Web Framework

This example shows how to deploy a Rust web application using the Axum framework on Vercel with streaming capabilities.

Demo

https://rust-axum.vercel.app

Project Structure

  • api/axum.rs - Main Axum application
    • / - Entrypoint with an interactive HTML interface for streaming
    • /stream - Streaming endpoint
    • /users - Post request endpoint
  • Cargo.toml - Rust dependencies and binary configuration
  • vercel.json - Vercel deployment configuration

Deploy

Deploy the example using Vercel:

Development

Clone the repository:

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