Skip to content

Commit

Permalink
Support actix-web: formatted boilerplate code for actix-web hello wor…
Browse files Browse the repository at this point in the history
…ld example
  • Loading branch information
maksim committed Nov 29, 2022
1 parent 12894bd commit 7a4bf49
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cargo-shuttle/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ impl ShuttleInit for ShuttleInitActixWeb {
fn get_boilerplate_code_for_framework(&self) -> &'static str {
indoc! {r#"
use actix_web::web::{resource, ServiceConfig};
use shuttle_service::{ShuttleActixWeb};
use shuttle_service::ShuttleActixWeb;
async fn hello_world() -> &'static str {
"Hello World!"
}
#[shuttle_service::main]
async fn actix_web() -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Sync + Send + Copy + Clone + 'static> {
async fn actix_web(
) -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Sync + Send + Copy + Clone + 'static> {
let h = hello_world;
Ok(move |cfg: &mut ServiceConfig| {
cfg.service(resource("/").to(h));
cfg.service(resource("/hello").to(h));
})
}"#}
}
Expand Down

0 comments on commit 7a4bf49

Please sign in to comment.