2024-03-29 16:20:53 -04:00
|
|
|
use std::net::TcpListener;
|
|
|
|
|
2024-05-03 15:43:34 -04:00
|
|
|
use email_newsletter_api::startup;
|
2024-03-28 11:42:08 -04:00
|
|
|
|
|
|
|
#[tokio::main]
|
2024-05-03 15:43:34 -04:00
|
|
|
async fn main() -> Result<(), std::io::Error> {
|
2024-03-29 16:20:53 -04:00
|
|
|
let listener = TcpListener::bind("127.0.0.1:8000").expect("Failed to bind to port 8000");
|
|
|
|
|
2024-03-29 15:36:54 -04:00
|
|
|
// Move the error up the call stack
|
|
|
|
// otherwise await for the HttpServer
|
2024-05-03 15:43:34 -04:00
|
|
|
startup::run(listener)?.await
|
2024-03-23 19:04:25 -04:00
|
|
|
}
|