-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
use std::net::TcpListener; | ||
|
||
use actix_real_world::{config, run::run}; | ||
use actix_real_world::{config, run::build}; | ||
|
||
/// main instantiates the configuration and build the server | ||
#[actix_web::main] | ||
async fn main() -> std::io::Result<()> { | ||
let conf = config::Settings::new().expect("Failed to read config file"); | ||
let addr = format!("{}:{}", conf.server.host, conf.server.port); | ||
let listener = TcpListener::bind(addr)?; | ||
let server = build(&conf).await?; | ||
|
||
server.await?; | ||
|
||
run(listener)?.await | ||
Ok(()) | ||
} |
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
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