Crate shuttle_actix_web
source ·Expand description
§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())
}
Structs§
- A wrapper type for a closure that returns an actix_web::web::ServiceConfig so we can implement shuttle_runtime::Service for it.
Type Aliases§
- Shuttle service integration for the Actix Web framework