From 563c32131d8f69e58ef9222576b1f893436a4d48 Mon Sep 17 00:00:00 2001 From: Matthew Gordon Date: Sat, 10 Feb 2024 23:22:47 -0400 Subject: [PATCH] Rename env variable to be less ambiguous --- .cargo/config.toml | 2 +- src/main.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index e7ba845..8b7033b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [env] -STATIC_FILE_PATH = { value = "static", relative = true } \ No newline at end of file +LOCALHUB_STATIC_FILE_PATH = { value = "static", relative = true } diff --git a/src/main.rs b/src/main.rs index ef15f19..34dd09e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,10 @@ use tower_http::services::ServeDir; async fn main() -> Result<(), Box> { let app = Router::new() .route("/", get(root)) - .nest_service("/static", ServeDir::new(env::var("STATIC_FILE_PATH")?)); + .nest_service( + "/static", + ServeDir::new(env::var("LOCALHUB_STATIC_FILE_PATH")?), + ); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?; axum::serve(listener, app).await?;