redir
This commit is contained in:
parent
5d2465353a
commit
52482085bc
2 changed files with 11 additions and 1 deletions
|
@ -32,6 +32,7 @@ async fn rocket() -> _ {
|
||||||
.mount(
|
.mount(
|
||||||
"/",
|
"/",
|
||||||
routes![
|
routes![
|
||||||
|
route::index_redir,
|
||||||
route::artist::artists_route,
|
route::artist::artists_route,
|
||||||
route::artist::artist_route,
|
route::artist::artist_route,
|
||||||
route::album::albums_route,
|
route::album::albums_route,
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
use rocket::response::status::BadRequest;
|
use rocket::{
|
||||||
|
get,
|
||||||
|
response::{status::BadRequest, Redirect},
|
||||||
|
uri,
|
||||||
|
};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
pub mod album;
|
pub mod album;
|
||||||
|
@ -31,3 +35,8 @@ pub async fn to_api(albums: &[impl ToAPI]) -> Vec<serde_json::Value> {
|
||||||
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[get("/")]
|
||||||
|
pub async fn index_redir() -> Redirect {
|
||||||
|
Redirect::to(uri!("/web"))
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue