diff --git a/src/main.rs b/src/main.rs index 4c1b3bf..6ef3c50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,10 +18,21 @@ async fn main() { // .route("/users", post(create_user)); // run our app with hyper, listening globally on port 3000 - let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); + let listener = tokio::net::TcpListener::bind(get_full()).await.unwrap(); axum::serve(listener, app).await.unwrap(); } +fn get_full() -> String { + get_address() + ":" + &get_port() +} +fn get_address() -> String { + String::from("0.0.0.0") +} + +fn get_port() -> String { + String::from("3000") +} + // basic handler that responds with a static string async fn root() -> &'static str { "Hello, World!"