Files
icarus_auth/src/main.rs
phoenix f2005de668
All checks were successful
Rust Build / Check (push) Successful in 29s
Rust Build / Test Suite (push) Successful in 35s
Rust Build / Rustfmt (push) Successful in 25s
Rust Build / Clippy (push) Successful in 29s
Rust Build / build (push) Successful in 38s
Release Tagging / release (push) Successful in 28s
Rust Build / Check (pull_request) Successful in 38s
Rust Build / Test Suite (pull_request) Successful in 33s
Rust Build / Rustfmt (pull_request) Successful in 25s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / build (pull_request) Successful in 38s
Fix build warnings (#3)
Reviewed-on: #3
Co-authored-by: phoenix <kundeng94@gmail.com>
Co-committed-by: phoenix <kundeng94@gmail.com>
2025-03-29 22:35:57 +00:00

42 lines
952 B
Rust

use axum::{
// Json,
Router,
// http::StatusCode,
routing::get,
// routing::{get, post},
};
// use serde::{Deserialize, Serialize};
#[tokio::main]
async fn main() {
// initialize tracing
tracing_subscriber::fmt::init();
// build our application with a route
let app = Router::new()
// `GET /` goes to `root`
.route("/", get(root));
// `POST /users` goes to `create_user`
// .route("/users", post(create_user));
// run our app with hyper, listening globally on port 3000
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!"
}