Slightly better routing on the server side

This commit is contained in:
Jeremy Wall 2022-11-01 19:28:39 -04:00
parent 3bf9af6f1e
commit 7e3b94261a

View File

@ -70,16 +70,7 @@ async fn ui_static_assets(Path(path): Path<String>) -> impl IntoResponse {
let mut path = path.trim_start_matches("/"); let mut path = path.trim_start_matches("/");
if UiAssets::get(path).is_none() { if UiAssets::get(path).is_none() {
path = match path { path = "index.html";
"" | "inventory" | "plan" | "cook" | "categories" | "login" => "index.html",
_ => {
if path.starts_with("recipe") {
"index.html"
} else {
path
}
}
};
} }
debug!(path = path, "Serving transformed path"); debug!(path = path, "Serving transformed path");
StaticFile(path.to_owned()) StaticFile(path.to_owned())