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")) +}