Axum hello world

This commit is contained in:
2026-08-11 18:38:33 -04:00
parent 531881aafe
commit 0e8dbdd549
3 changed files with 501 additions and 2 deletions
+10 -2
View File
@@ -1,3 +1,11 @@
fn main() {
println!("Hello, world!");
use axum::{Router, routing::get};
#[tokio::main]
async fn main() {
// build our application with a single route
let app = Router::new().route("/", get(|| async { "Hello, World!" }));
// run our app with hyper, listening globally on port 3000
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();
}