From 3b14bb57ca82a94a36194c8d38afcea53d9ce041 Mon Sep 17 00:00:00 2001 From: slhx agent Date: Tue, 23 Jun 2026 15:55:52 +0200 Subject: [PATCH] chore(examples): make html-examples port configurable via env req: examples/001 --- examples/html_examples/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/html_examples/src/main.rs b/examples/html_examples/src/main.rs index 54cd925..93bca91 100644 --- a/examples/html_examples/src/main.rs +++ b/examples/html_examples/src/main.rs @@ -230,7 +230,11 @@ async fn main() { .route("/app.css", get(css)) .with_state(state); - let addr = SocketAddr::from(([127, 0, 0, 1], 3029)); + let port = std::env::var("HEMX_HTML_EXAMPLES_PORT") + .unwrap_or_else(|_| "3029".to_string()) + .parse::() + .expect("HEMX_HTML_EXAMPLES_PORT must be a valid u16"); + let addr = SocketAddr::from(([127, 0, 0, 1], port)); let listener = tokio::net::TcpListener::bind(addr).await.unwrap(); println!("hemx HTML examples: http://{addr}"); axum::serve(listener, app).await.unwrap();