socle 0.1.1

Opinionated axum service bootstrap: telemetry, database, rate limiting, and shutdown in one builder
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Minimal service: telemetry + one route.

use axum::{Router, routing::get};
use socle::{BootstrapCtx, Result, ServiceBootstrap};

#[tokio::main]
async fn main() -> Result<()> {
    ServiceBootstrap::new("my-service")
        .with_telemetry()
        .with_router(|_ctx: &BootstrapCtx| Router::new().route("/health", get(|| async { "ok" })))
        .serve("0.0.0.0:8080")
        .await
}