use rocket::{ get, response::{status::BadRequest, Redirect}, uri, }; use serde_json::json; pub mod admin; pub mod album; pub mod artist; pub mod event; pub mod playlist; pub mod search; pub mod track; pub mod user; // todo : rework api type ApiError = BadRequest; type FallibleApiResponse = Result; pub fn api_error(msg: &str) -> ApiError { BadRequest(json!({ "error": msg })) } #[get("/")] pub fn index_redir() -> Redirect { Redirect::to(uri!("/web")) } #[get("/manifest.json")] pub fn manifest_redir() -> Redirect { Redirect::to(uri!("/web/manifest.json")) }