Rename env variable to be less ambiguous

This commit is contained in:
Matthew Gordon 2024-02-10 23:22:47 -04:00
parent 5e90f3436a
commit 563c32131d
2 changed files with 5 additions and 2 deletions

View File

@ -1,2 +1,2 @@
[env]
STATIC_FILE_PATH = { value = "static", relative = true }
LOCALHUB_STATIC_FILE_PATH = { value = "static", relative = true }

View File

@ -7,7 +7,10 @@ use tower_http::services::ServeDir;
async fn main() -> Result<(), Box<dyn std::error::Error>> {
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?;