commit 02992f56ec6dea1ff5153cb6dec88d89c852f2cf Author: Samuel Jones Date: Fri Jun 12 15:31:01 2026 +0100 First hello world. diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..dad9728 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "fares_site" +version = "0.1.0" +edition = "2024" + +[dependencies] +axum = "0.8.9" +tokio = { version = "1.52.3", features = ["rt-multi-thread"] } +html = "0.6.3" diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..ebfe6ed --- /dev/null +++ b/src/main.rs @@ -0,0 +1,20 @@ +use axum::{Router, routing::get}; + +#[tokio::main] +async fn main() { + let app = Router::new() + .route( + "/", + get(|| async { "Incorrect reverse-proxy, '/' should be handled elsewhere." }), + ) + .route("/fares", get(app)); + let listener = tokio::net::TcpListener::bind("0.0.0.0:8000").await.unwrap(); + axum::serve(listener, app).await.unwrap(); +} + +async fn app() -> String { + let tree = html::text_content::Division::builder() + .text("Hello Fares!") + .build(); + tree.to_string() +}