1. Web server or vercel_runtime [[bin]]
Deploy a standard Rust HTTP server (such as Axum or Actix-web) listening on PORT, or keep Vercel’s api/*.rs [[bin]] layout using the vercel_runtime crate (forkrail passes VERCEL_DEV_PORT automatically):
use axum::{routing::get, Json, Router};use serde_json::json;#[tokio::main]async fn main() { let app = Router::new() .route("/health", get(|| async { Json(json!({ "ok": true })) })); let port = std::env::var("PORT").unwrap_or_else(|_| "8080".into()); let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}")).await.unwrap(); axum::serve(listener, app).await.unwrap();}2. Deploy & cache builds
forkrail compiles releases with cargo zigbuild --release targeting Amazon Linux 2023’s glibc 2.34 (aarch64-unknown-linux-gnu.2.34) and caches both the Cargo registry and target/ directory so incremental deploys stay fast.
forkrail deployforkrail deploy --prodRelated documentation
Ready to deploy your Rust project inside your own AWS account?
Quickstart