Use static directory.

This commit is contained in:
didier amyot committed 2023-02-11 07:20:17 -05:00
1 parent eca4820fd2
commit 86598c0fb7
10 files changed
+31 -17

No files matched your search

-11
View File
@@ -3,7 +3,6 @@ use actix_web::http::header::q;
use clap::builder::TypedValueParser;
use minijinja::context;
use serde::Deserialize;
use std::collections::HashMap;
use log::info;
use resource::resource_str;
@@ -56,16 +55,6 @@ pub async fn actions_partials(
tmpl_env.render(template_location.as_str(), ctx)
}
#[actix_web::get("/static/{file_name}")]
pub async fn static_file(
req: HttpRequest
) -> actix_web::Result<impl Responder> {
let file_name = req.match_info().get("file_name").unwrap_or(&"404.html".to_string()).to_string();
let template_location = format!("static/{:}", file_name);
info!("Getting static file: {:?}", file_name);
Ok(template_location)
}
#[derive(Deserialize, Debug)]
struct Event1{