Application host

Axum application shell pieces live in id_effect_axum::server (lifecycle, config bootstrap, security middleware). Portable auth traits live in id_effect_platform::auth.

Lifecycle

HostBuilder loads HostConfig from HOST, PORT, and SHUTDOWN_TIMEOUT_SECS, then runs your serve future concurrently with SIGINT/SIGTERM:

#![allow(unused)]
fn main() {
use id_effect_axum::{HostBuilder, serve_router};

HostBuilder::new()
  .run_until_shutdown(|host| async move {
    serve_router(host, app).await
  })
  .await?;
}

See cargo run -p id_effect_axum --example 040_app_host.

Sessions and OAuth

Trait-only v1 — bring your own store/IdP via id_effect_platform::auth:

Security middleware

From id_effect_axum::server:

See also

  • Mission: platform-application
  • Platform auth: Part VI ch26 (id_effect_platform::auth)