Quick Start

adjust is a library for building backend services on top of axum. It includes:

  • Controllers

  • Fast service initialization (in just a few lines) without hassle

  • Automatic AppState setup

  • Built-in support for Postgres (via Diesel) and Redis

  • Cookie manager (with the cookie feature)

  • Out-of-the-box integration with tokio and serde

Example

// use ...;

#[derive(Clone)
struct AppState {
  postgres: Pool<Postgres>,
  redis: Pool<Redis>
}

#[adjust::main]
async fn main() -> Service<AppState> {
  Service {
    name: "Example Service",
    controllers: controllers![OpenApiController, OAuthController, OpenIDController],
    ..Default::default()
  }
}

Last updated