From 42678ba1efe83b7f55bcb56df8ae89c43ef30d24 Mon Sep 17 00:00:00 2001 From: LostLuma Date: Sat, 16 Nov 2024 21:30:14 +0100 Subject: [PATCH] Add redirect from / to /docs --- echo/src/main.rs | 1 + echo/src/routes/mod.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/echo/src/main.rs b/echo/src/main.rs index 5a43e1a..ae0b85a 100644 --- a/echo/src/main.rs +++ b/echo/src/main.rs @@ -21,6 +21,7 @@ pub mod utils; #[rocket::launch] fn rocket() -> _ { let routes = routes![ + routes::get_root, cors::snatcher, docs::get_docs, docs::get_spec, diff --git a/echo/src/routes/mod.rs b/echo/src/routes/mod.rs index 17092f9..f72b221 100644 --- a/echo/src/routes/mod.rs +++ b/echo/src/routes/mod.rs @@ -1,4 +1,11 @@ +use rocket::{get, response::Redirect, uri}; + pub mod docs; pub mod health; pub mod pastes; pub mod security; + +#[get("/")] +pub fn get_root() -> Redirect { + Redirect::temporary(uri!("/docs")) +}