From c845a4679c492fe61744d7b54e64ff78fb8beb93 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sun, 17 Apr 2022 02:31:43 +0300 Subject: Add 404 support --- src/routes.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/routes.rs b/src/routes.rs index 4dd22bc..c0ccd26 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -1,14 +1,15 @@ //! # Endpoints and their construction // -use warp::{Filter, Rejection, Reply}; use crate::custom_filters; use crate::handlers; use crate::Db; +use warp::{Filter, Rejection, Reply}; /// Every route combined pub fn application(db: Db) -> impl Filter + Clone { // gradecoin-site (zola) outputs a public/, we serve it here let static_route = warp::any().and(warp::fs::dir("public")); + let error_page = warp::any().and(warp::fs::file("public/404.html")); transaction_list(db.clone()) .or(register_user(db.clone())) @@ -17,6 +18,7 @@ pub fn application(db: Db) -> impl Filter