fix: restructure the logic

This commit is contained in:
2024-05-03 15:43:34 -04:00
parent 53f20f16f4
commit f08def8e77
8 changed files with 44 additions and 32 deletions

View File

@@ -11,7 +11,7 @@ pub fn spawn_app() -> String {
let port = listener.local_addr().unwrap().port();
let server = email_newsletter_api::run(listener).expect("Failed to bind address");
let server = email_newsletter_api::startup::run(listener).expect("Failed to bind address");
/* `tokio::spawn(/*async task*/)` will spawn an async task to be run.
We can continue executing other code concurrently while `task` runs in the background.