Initial 404 page #13
This commit is contained in:
parent
9b75dbb7d2
commit
0612b09ca0
2 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,9 @@ mod config;
|
||||||
#[path = "routes/index.rs"]
|
#[path = "routes/index.rs"]
|
||||||
mod index;
|
mod index;
|
||||||
|
|
||||||
|
#[path = "routes/not_found.rs"]
|
||||||
|
mod not_found;
|
||||||
|
|
||||||
#[path = "routes/agreements.rs"]
|
#[path = "routes/agreements.rs"]
|
||||||
mod agreements;
|
mod agreements;
|
||||||
|
|
||||||
|
@ -22,6 +25,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
.service(agreements::humans)
|
.service(agreements::humans)
|
||||||
.service(agreements::robots)
|
.service(agreements::robots)
|
||||||
.service(agreements::sitemap)
|
.service(agreements::sitemap)
|
||||||
|
.default_service(web::to(not_found::page))
|
||||||
})
|
})
|
||||||
.bind(addr)?
|
.bind(addr)?
|
||||||
.run()
|
.run()
|
||||||
|
|
5
src/routes/not_found.rs
Normal file
5
src/routes/not_found.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
use actix_web::{HttpResponse, Responder};
|
||||||
|
|
||||||
|
pub async fn page() -> impl Responder {
|
||||||
|
HttpResponse::NotFound().body("404 :/")
|
||||||
|
}
|
Loading…
Reference in a new issue