5 releases

new 0.2.1 Feb 4, 2025
0.2.0 Apr 22, 2024
0.1.2 Jan 9, 2024
0.1.1 Dec 21, 2023
0.1.0 Sep 26, 2023

#224 in HTTP server

Download history 2/week @ 2024-10-19 6/week @ 2024-10-26 16/week @ 2024-11-02 3/week @ 2024-11-09 11/week @ 2024-11-16 24/week @ 2024-11-23 28/week @ 2024-11-30 15/week @ 2024-12-07 38/week @ 2024-12-14 6/week @ 2024-12-21 4/week @ 2025-01-04 20/week @ 2025-01-11 8/week @ 2025-01-18 14/week @ 2025-01-25 121/week @ 2025-02-01

165 downloads per month

MIT/Apache and maybe GPL-3.0-or-later

92KB
2K SLoC

Serwus

Helpers for building actix-web/diesel based services.

crates.io Documentation MIT or Apache 2.0 licensed Dependency Status CI downloads

Features

  • MultiPool - Master/replica-aware wrapper for r2d2
  • StatsPresenter - Framework for readiness and statistics reporting
  • JsonError - Middleware that makes actix-web return errors as JSONs

Example

use actix_web::web;
use serwus::{
    server::{Serwus, default_cors},
    EmptyStats
};

#[derive(Clone, EmptyStats)]
pub struct AppData;

async fn hello() -> &'static str {
    "Hello world\n"
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    let prepare_app_data = || AppData;

    Serwus::default()
        .start(
            prepare_app_data,
            |app| {
                app.route("/", web::get().to(hello));
            },
            default_cors,
        )
        .await
}

Dependencies

~20–43MB
~745K SLoC