17 lines
442 B
Rust
Raw Normal View History

2024-07-14 15:14:52 -04:00
use axum::routing::get;
use axum::Router;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let app = Router::new().route("/health", get(health));
let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await?;
println!("Listening on port 8080. Pop open your browser to http://127.0.0.1:8080/ .");
axum::serve(listener, app).await?;
Ok(())
}
async fn health() -> &'static str {
"ok"
2024-07-14 14:52:45 -04:00
}