7 releases
Uses new Rust 2024
| 0.2.3 | Jan 23, 2026 |
|---|---|
| 0.2.2 | Oct 25, 2025 |
| 0.2.1 | Feb 4, 2025 |
| 0.2.0 | Apr 22, 2024 |
| 0.1.0 | Sep 26, 2023 |
#747 in HTTP server
485 downloads per month
93KB
2.5K
SLoC
Serwus
Helpers for building actix-web/diesel based services.
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
~23–55MB
~809K SLoC