Crate shuttle_axum

Source
Expand description

§Shuttle service integration for the Axum web framework

Axum 0.8 is used by default.

Axum 0.7 is supported by using these feature flags:

axum = "0.7.3"
shuttle-axum = { version = "...", default-features = false, features = ["axum-0-7"] }

§Example

use axum::{routing::get, Router};

async fn hello_world() -> &'static str {
    "Hello, world!"
}

#[shuttle_runtime::main]
async fn axum() -> shuttle_axum::ShuttleAxum {
    let router = Router::new().route("/", get(hello_world));

    Ok(router.into())
}

Re-exports§

pub use axum;

Structs§

AxumService
A wrapper type for axum::Router so we can implement shuttle_runtime::Service for it.

Type Aliases§

ShuttleAxum
Shuttle service integration for the Axum web framework