axum-helpers 0.1.0

Axum service building blocks: server lifecycle with graceful shutdown, health checks, structured errors, validated extractors, security middleware, rate limiting, and Prometheus metrics
docs.rs failed to build axum-helpers-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Axum Helpers

A collection of utilities, middleware, and helpers for building Axum web applications.

Modules

  • [auth]: JWT authentication with Redis-backed whitelist/blacklist
  • [server]: Server setup, health checks, graceful shutdown
  • [http]: HTTP middleware (CORS, CSRF, security headers)
  • [errors]: Structured error responses with error codes
  • [extractors]: Custom extractors (UUID path, validated JSON)
  • [audit]: Audit logging for security and compliance

Quick Start

use axum::Router;
use axum_helpers::server::{create_app, create_router};
use core_config::server::ServerConfig;
use utoipa::OpenApi;

#[derive(OpenApi)]
#[openapi(paths())]
struct ApiDoc;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_routes = Router::new(); // Add your routes
    let router = create_router::<ApiDoc>(api_routes).await?;

    let config = ServerConfig::default();
    create_app(router, &config).await?;
    Ok(())
}