From 867eb24d5d7f4e8b5c24fc3af7515a53a780ec83 Mon Sep 17 00:00:00 2001 From: Imbus Date: Sun, 5 Nov 2023 19:16:00 +0100 Subject: [PATCH] Default handler for root path set to index.html --- server/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main.rs b/server/src/main.rs index 6d95008..c7ca643 100755 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -37,7 +37,11 @@ async fn main() -> std::io::Result<()> { .app_data(Data::new(data.clone())) .app_data(Data::new(capt_db.clone())), ) - .service(Files::new("/", "./public").index_file("index.html")) + .service( + Files::new("/", "./public") + .index_file("index.html") + .default_handler(actix_files::NamedFile::open("./public/index.html").unwrap()), + ) }) .bind("0.0.0.0:8080")? .run()