Skip to main content

Crate altair_server

Crate altair_server 

Source
Expand description

Axum + tower-http convenience layer.

Wraps an axum::Router with a sensible-default middleware stack (tracing, request-id propagation, request timeout), a built-in /health endpoint, and SIGINT/SIGTERM-aware graceful shutdown. The underlying axum, tower, and tower-http crates are re-exported at the crate root so consumers don’t need to add them as separate dependencies.

§Example

use altair_server::Server;
use altair_server::axum::routing::get;

Server::builder()
    .bind_addr("0.0.0.0:3000")
    .route("/", get(|| async { "hello" }))
    .build()
    .await?
    .run()
    .await

Re-exports§

pub use ::axum;
pub use ::tower;
pub use ::tower_http;

Modules§

prelude
Common imports for users of this crate.

Structs§

Server
Configured server, bound to a TCP listener.
ServerBuilder
Typed builder for Server.

Enums§

Error
Errors returned by altair-server operations.

Functions§

shutdown_signal
Future that resolves when the process receives SIGINT (Ctrl-C) on all platforms, or SIGTERM on Unix.

Type Aliases§

Result
Convenience result alias for this crate.