mirror of https://github.com/spikecodes/libreddit
Unknown path error handling
This commit is contained in:
parent
b8cdc605a2
commit
ef1ad17234
|
@ -47,7 +47,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
// TRAILING SLASH MIDDLEWARE
|
// TRAILING SLASH MIDDLEWARE
|
||||||
.wrap(NormalizePath::default())
|
.wrap(NormalizePath::default())
|
||||||
// DEFAULT SERVICE
|
// DEFAULT SERVICE
|
||||||
.default_service(web::get().to(utils::error))
|
.default_service(web::get().to(|| utils::error("Nothing here".to_string())))
|
||||||
// GENERAL SERVICES
|
// GENERAL SERVICES
|
||||||
.route("/style.css/", web::get().to(style))
|
.route("/style.css/", web::get().to(style))
|
||||||
.route("/favicon.ico/", web::get().to(HttpResponse::Ok))
|
.route("/favicon.ico/", web::get().to(HttpResponse::Ok))
|
||||||
|
|
|
@ -42,7 +42,7 @@ pub async fn profile(req: HttpRequest) -> HttpResponse {
|
||||||
HttpResponse::Ok().content_type("text/html").body(s)
|
HttpResponse::Ok().content_type("text/html").body(s)
|
||||||
}
|
}
|
||||||
// If there is an error show error page
|
// If there is an error show error page
|
||||||
Err(msg) => {dbg!(msg);error(msg.to_string()).await},
|
Err(msg) => error(msg.to_string()).await,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue