From ab0b5e35dfc149b21665200b7820a8f9d3aed931 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sun, 14 Aug 2022 17:01:34 +0530 Subject: [PATCH] fix: serve upload dir and not ./tmp --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 87c0910..304413f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -89,6 +89,7 @@ async fn main() -> std::io::Result<()> { let ctx = actix_web::web::Data::new(ctx); let ip = settings.server.get_ip(); + let upload_path = settings.files.path; println!("Starting server on: http://{ip}"); HttpServer::new(move || { @@ -104,7 +105,7 @@ async fn main() -> std::io::Result<()> { )) .app_data(get_json_err()) .configure(routes::services) - .service(Files::new("/", "./tmp").show_files_listing()) + .service(Files::new("/", &upload_path).show_files_listing()) }) .bind(ip)? .run()