File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " hello-world"
3+ version = " 0.1.0"
4+ edition = " 2021"
5+
6+ [dependencies ]
7+ actix-service = " 2.0.2"
8+ actix-web = " 4.2.1"
9+ shuttle-service = { version = ' 0.7.2' , features = [" web-actix-web" ] }
10+
Original file line number Diff line number Diff line change 1+ name = " hello-world-actix-web-app"
Original file line number Diff line number Diff line change 1+ use actix_web:: web:: { resource, ServiceConfig } ;
2+ use shuttle_service:: ShuttleActixWeb ;
3+
4+ async fn hello_world ( ) -> & ' static str {
5+ "Hello World!"
6+ }
7+
8+ #[ shuttle_service:: main]
9+ async fn actix_web (
10+ ) -> ShuttleActixWeb < impl FnOnce ( & mut ServiceConfig ) + Sync + Send + Copy + Clone + ' static > {
11+ Ok ( move |cfg : & mut ServiceConfig | {
12+ cfg. service ( resource ( "/hello" ) . to ( hello_world) ) ;
13+ } )
14+ }
You can’t perform that action at this time.
0 commit comments