mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Slightly better routing on the server side
This commit is contained in:
parent
3bf9af6f1e
commit
7e3b94261a
@ -70,16 +70,7 @@ async fn ui_static_assets(Path(path): Path<String>) -> impl IntoResponse {
|
||||
|
||||
let mut path = path.trim_start_matches("/");
|
||||
if UiAssets::get(path).is_none() {
|
||||
path = match path {
|
||||
"" | "inventory" | "plan" | "cook" | "categories" | "login" => "index.html",
|
||||
_ => {
|
||||
if path.starts_with("recipe") {
|
||||
"index.html"
|
||||
} else {
|
||||
path
|
||||
}
|
||||
}
|
||||
};
|
||||
path = "index.html";
|
||||
}
|
||||
debug!(path = path, "Serving transformed path");
|
||||
StaticFile(path.to_owned())
|
||||
|
Loading…
x
Reference in New Issue
Block a user