From 52482085bc1fde11c4fff88989e5496d38cd900b Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 1 Aug 2024 16:42:58 +0200 Subject: [PATCH] redir --- src/main.rs | 1 + src/route/mod.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 6388d04..aa8ad63 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,6 +32,7 @@ async fn rocket() -> _ { .mount( "/", routes![ + route::index_redir, route::artist::artists_route, route::artist::artist_route, route::album::albums_route, diff --git a/src/route/mod.rs b/src/route/mod.rs index f608d0b..8a0df65 100644 --- a/src/route/mod.rs +++ b/src/route/mod.rs @@ -1,4 +1,8 @@ -use rocket::response::status::BadRequest; +use rocket::{ + get, + response::{status::BadRequest, Redirect}, + uri, +}; use serde_json::json; pub mod album; @@ -31,3 +35,8 @@ pub async fn to_api(albums: &[impl ToAPI]) -> Vec { ret } + +#[get("/")] +pub async fn index_redir() -> Redirect { + Redirect::to(uri!("/web")) +}