shuttle-actix-web

Crates.ioshuttle-actix-web
lib.rsshuttle-actix-web
version0.48.0
sourcesrc
created_at2023-03-14 12:22:32.877741
updated_at2024-10-01 14:36:46.391213
descriptionService implementation to run an actix webserver on shuttle
homepage
repositoryhttps://github.com/shuttle-hq/shuttle
max_upload_size
id809804
size3,219
Release (github:shuttle-hq:release)

documentation

README

Shuttle service integration for the Actix Web framework

Example

use actix_web::{get, web::ServiceConfig};
use shuttle_actix_web::ShuttleActixWeb;

#[get("/")]
async fn hello_world() -> &'static str {
    "Hello World!"
}

#[shuttle_runtime::main]
async fn actix_web() -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Send + Clone + 'static> {
    let config = move |cfg: &mut ServiceConfig| {
        cfg.service(hello_world);
    };

    Ok(config.into())
}
Commit count: 1381

cargo fmt