Default handler for root path set to index.html

This commit is contained in:
Imbus 2023-11-05 19:16:00 +01:00
parent b3124948c4
commit 867eb24d5d

View file

@ -37,7 +37,11 @@ async fn main() -> std::io::Result<()> {
.app_data(Data::new(data.clone())) .app_data(Data::new(data.clone()))
.app_data(Data::new(capt_db.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")? .bind("0.0.0.0:8080")?
.run() .run()