mylloon.fr/src/routes/not_found.rs

17 lines
364 B
Rust
Raw Normal View History

2023-02-08 22:27:40 +01:00
use actix_web::{HttpResponse, Responder};
2023-02-09 10:55:49 +01:00
use askama::Template;
2023-02-08 22:27:40 +01:00
2023-02-09 11:19:53 +01:00
use crate::template::render_html;
2023-02-08 22:27:40 +01:00
pub async fn page() -> impl Responder {
2023-02-09 10:55:49 +01:00
HttpResponse::NotFound().body(get_page())
}
#[derive(Template)]
#[template(path = "../templates/404.html")]
struct Error404Template {}
pub fn get_page() -> std::string::String {
2023-02-09 11:19:53 +01:00
render_html(&Error404Template {})
2023-02-08 22:27:40 +01:00
}