Crates.io | shuttle-actix-web |
lib.rs | shuttle-actix-web |
version | 0.48.0 |
source | src |
created_at | 2023-03-14 12:22:32.877741 |
updated_at | 2024-10-01 14:36:46.391213 |
description | Service implementation to run an actix webserver on shuttle |
homepage | |
repository | https://github.com/shuttle-hq/shuttle |
max_upload_size | |
id | 809804 |
size | 3,219 |
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())
}