add debug route

This commit is contained in:
2023-08-29 21:34:00 +02:00
parent af608742fb
commit c3ac227952

View File

@@ -192,6 +192,7 @@ async fn main() -> Result<(), StartError> {
})
}),
)
.route("/debug", get(debug))
.nest(
(&TopLevelPage::Trips.path()).into(),
Router::new()
@@ -290,6 +291,17 @@ async fn root() -> impl IntoResponse {
view::Root::build(&view::home::Home::build(), None)
}
async fn debug(headers: HeaderMap) -> impl IntoResponse {
let out = {
let mut out = String::new();
for (key, value) in headers.iter() {
out.push_str(&format!("{}: {}\n", key, value.to_str().unwrap()));
}
out
};
out
}
#[derive(Deserialize, Default)]
struct InventoryQuery {
edit_item: Option<Uuid>,