| Crates.io | serwus |
| lib.rs | serwus |
| version | 0.2.1 |
| created_at | 2023-09-26 06:54:51.292765+00 |
| updated_at | 2025-02-04 10:59:51.338899+00 |
| description | Helpers for building actix-web/diesel based services |
| homepage | https://github.com/sfisol/serwus |
| repository | https://github.com/sfisol/serwus |
| max_upload_size | |
| id | 983352 |
| size | 106,732 |
Helpers for building actix-web/diesel based services.
r2d2use 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
}