Some changes

This commit is contained in:
KD
2025-03-29 09:54:56 -04:00
parent 57ca0afded
commit a57898cf52
+12 -1
View File
@@ -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!"