chore: Initialize Axum as webserver

This commit is contained in:
2024-07-03 16:40:36 +02:00
parent 77f520a1a3
commit 677740c28c
2 changed files with 21 additions and 0 deletions

13
src/main.rs Normal file
View File

@ -0,0 +1,13 @@
use axum::{
routing::get,
Router,
};
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/", get(|| async { "Hello, World!" }));
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();
}