Created
October 12, 2021 18:08
-
-
Save tjmaynes/a72b1d661c9d3d2c55f66901195c37b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
let app_state = web::Data::new(AppState { | |
db_conn: db_conn | |
}); | |
HttpServer::new(move || { | |
App::new() | |
.app_data(app_state.clone()) // <- cloned app_state variable | |
.route("/health", web::get().to(get_health_status)) | |
}) | |
.bind(("127.0.0.1", 8080))? | |
.run() | |
.await |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment