Rename env variable to be less ambiguous
This commit is contained in:
parent
5e90f3436a
commit
563c32131d
|
|
@ -1,2 +1,2 @@
|
|||
[env]
|
||||
STATIC_FILE_PATH = { value = "static", relative = true }
|
||||
LOCALHUB_STATIC_FILE_PATH = { value = "static", relative = true }
|
||||
|
|
|
|||
|
|
@ -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?;
|
||||
|
|
|
|||
Loading…
Reference in New Issue