diff --git a/src/endpoints/default_route_404.rs b/src/endpoints/default_route_404.rs
new file mode 100644
index 0000000000..ad5f379a43
--- /dev/null
+++ b/src/endpoints/default_route_404.rs
@@ -0,0 +1,10 @@
+use actix_http::http::StatusCode;
+use actix_web::{HttpResponse, HttpRequest, Responder, get};
+use log::warn;
+
+pub async fn default_route_404() -> impl Responder {
+ warn!("404 not found");
+ HttpResponse::NotFound()
+ .content_type("text/html; charset=utf-8")
+ .body("
nope
")
+}
diff --git a/src/endpoints/mod.rs b/src/endpoints/mod.rs
index daae90cd5b..d21a0a3a4b 100644
--- a/src/endpoints/mod.rs
+++ b/src/endpoints/mod.rs
@@ -1,2 +1,3 @@
+pub mod default_route_404;
pub mod root_index;
pub mod users;
\ No newline at end of file
diff --git a/src/main.rs b/src/main.rs
index 0fe338815c..4d5b87d10a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -29,6 +29,7 @@ use crate::endpoints::users::logout::logout_handler;
use crate::util::session_checker::SessionChecker;
use crate::endpoints::users::session_info::session_info_handler;
use crate::endpoints::root_index::get_root_index;
+use crate::endpoints::default_route_404::default_route_404;
const DEFAULT_BIND_ADDRESS : &'static str = "0.0.0.0:12345";
const DEFAULT_RUST_LOG: &'static str = "debug,actix_web=info";
@@ -158,6 +159,7 @@ pub async fn serve(server_state: ServerState) -> AnyhowResult<()>
.route(web::head().to(|| HttpResponse::Ok()))
)
.service(get_root_index)
+ .default_service( web::route().to(default_route_404))
})
.bind(bind_address)?
.workers(num_workers)