add tower and assets

This commit is contained in:
Agahnim 2026-03-19 14:14:50 +01:00
parent da61dfde87
commit 27c41667c3
72 changed files with 82 additions and 2 deletions

View file

@ -1,3 +1,14 @@
fn main() {
println!("Hello, world!");
use axum::{Router, routing::get};
use tower_http::services::ServeDir;
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/", get(|| async { "Hello World" }))
.nest_service("/static", ServeDir::new("static"));
let listener = tokio::net::TcpListener::bind("0.0.0.0:7122")
.await
.expect("Failed to bind to port 7122");
axum::serve(listener, app).await.expect("Server error");
}