Seperate into multiple files. Add configuration options
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
use std::net::TcpListener;
|
||||
use mail_app::startup::run;
|
||||
|
||||
// Create new instance of the application on a random port and return address [`http://localhost:XXXX`]
|
||||
fn spawn_app() -> String {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind to random port");
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
|
||||
let server = mail_app::run(listener).expect("Failed to bind address");
|
||||
let server = run(listener).expect("Failed to bind address");
|
||||
|
||||
let _ = tokio::spawn(server);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user