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()
.awaitRe-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.
- Server
Builder - Typed builder for
Server.
Enums§
- Error
- Errors returned by
altair-serveroperations.
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.