1. Examples
  2. Warp

Hello world!

Simple ‘Hello world’ app using Warp.

Create a new directory (mkdir) and move into it (cd) — afterwards, execute the following command to initialize shuttle inside with the Warp boilerplate.

cargo shuttle init --warp

Make sure that your Cargo.toml file looks like the one below — having the right dependencies is key!

name = "hello-world"
version = "0.1.0"
edition = "2021"


shuttle-service = { version = "0.9.0", features = ["web-warp"] }
warp = "0.3.2"

Your lib.rs should look like this:

use warp::Filter;
use warp::Reply;

async fn warp() -> shuttle_service::ShuttleWarp<(impl Reply,)> {
    let route = warp::any().map(|| "Hello, World");

Finally, to deploy your app, all you need to do is:

cargo shuttle deploy

And your app is live! 🎉🎉🎉