diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2022-09-10 10:58:47 +0000 |
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-10 10:58:47 +0000 |
| commit | 22d993b7c076c591cde13105b8f6707433945842 (patch) | |
| tree | 0f0158c2e59d5fa502a615cf2ae08264f10ee859 /src/main.rs | |
| parent | eb0c91b62ae10cbf8b6c787313855a9efd63f2f0 (diff) | |
Raise 404 error for not route found
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 59ffb24..4f548d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,7 @@ mod pagination; mod routes; use axum::{ + handler::Handler, http::{header, Request}, Router, }; @@ -43,6 +44,7 @@ async fn create_app() -> Router { Router::new() // Map all routes to `/v1/*` namespace .nest("/v1", api_routes) + .fallback(crate::routes::page_404.into_service()) // Mark the `Authorization` request header as sensitive so it doesn't // show in logs. .layer(SetSensitiveHeadersLayer::new(std::iter::once( |
