diff --git a/src/main.rs b/src/main.rs index 42754c9..4d1632c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,9 @@ mod config; #[path = "routes/index.rs"] mod index; +#[path = "routes/not_found.rs"] +mod not_found; + #[path = "routes/agreements.rs"] mod agreements; @@ -22,6 +25,7 @@ async fn main() -> std::io::Result<()> { .service(agreements::humans) .service(agreements::robots) .service(agreements::sitemap) + .default_service(web::to(not_found::page)) }) .bind(addr)? .run() diff --git a/src/routes/not_found.rs b/src/routes/not_found.rs new file mode 100644 index 0000000..462b8c7 --- /dev/null +++ b/src/routes/not_found.rs @@ -0,0 +1,5 @@ +use actix_web::{HttpResponse, Responder}; + +pub async fn page() -> impl Responder { + HttpResponse::NotFound().body("404 :/") +}