V0.2 web api #113

Merged
kdeng00 merged 9 commits from v0.2-web_api into v0.2 2025-03-30 15:00:07 -04:00
Showing only changes of commit a57898cf52 - Show all commits
+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!"