Skip to content

Commit 42678ba

Browse files
committed
Add redirect from / to /docs
1 parent 9ad4cdd commit 42678ba

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

echo/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub mod utils;
2121
#[rocket::launch]
2222
fn rocket() -> _ {
2323
let routes = routes![
24+
routes::get_root,
2425
cors::snatcher,
2526
docs::get_docs,
2627
docs::get_spec,

echo/src/routes/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
use rocket::{get, response::Redirect, uri};
2+
13
pub mod docs;
24
pub mod health;
35
pub mod pastes;
46
pub mod security;
7+
8+
#[get("/")]
9+
pub fn get_root() -> Redirect {
10+
Redirect::temporary(uri!("/docs"))
11+
}

0 commit comments

Comments
 (0)