Use static directory.
This commit is contained in:
1 parent
eca4820fd2
commit
86598c0fb7
10 files changed
+31
-17
No files matched your search
+6
-1
@@ -11,6 +11,7 @@ use std::path::Path;
|
||||
use std::{collections::HashMap, env, fs, io, path::PathBuf};
|
||||
use tokio::time::{sleep, Duration};
|
||||
use futures::{pin_mut, select, FutureExt};
|
||||
use actix_files;
|
||||
|
||||
|
||||
|
||||
@@ -92,12 +93,16 @@ pub async fn web_ui_main(port: u16, enable_template_autoreload: bool) -> std::io
|
||||
let server = HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(tmpl_reloader.clone())
|
||||
.service(
|
||||
actix_files::Files::new("/static", "./resources/static/")
|
||||
.show_files_listing()
|
||||
.use_last_modified(true),
|
||||
)
|
||||
.service(views::index)
|
||||
.service(views::actions)
|
||||
.service(views::overview)
|
||||
.service(views::overview_submit_button)
|
||||
.service(views::actions_partials)
|
||||
.service(views::static_file)
|
||||
.service(views::push_event)
|
||||
.wrap(ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found))
|
||||
.wrap(Logger::default())
|
||||
|
||||
Reference in new issue
Block a user