diff --git a/src/routes/not_found.rs b/src/routes/not_found.rs index 462b8c7..bdd9f8a 100644 --- a/src/routes/not_found.rs +++ b/src/routes/not_found.rs @@ -1,5 +1,16 @@ use actix_web::{HttpResponse, Responder}; +use askama::Template; pub async fn page() -> impl Responder { - HttpResponse::NotFound().body("404 :/") + HttpResponse::NotFound().body(get_page()) +} + +#[derive(Template)] +#[template(path = "../templates/404.html")] +struct Error404Template {} + +pub fn get_page() -> std::string::String { + let index = Error404Template {}; + + index.render().unwrap() } diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..c5f5f8a --- /dev/null +++ b/templates/404.html @@ -0,0 +1,42 @@ + + + + Erreur 404 + + + + + + + + + + + + + + + + + + + + + +

404 :/

+ +