From f4308b70c61c1168c59ea07da93701a406b6d736 Mon Sep 17 00:00:00 2001 From: akarras Date: Wed, 10 Jan 2024 16:28:21 -0700 Subject: [PATCH] add redirect for old /listings/ route --- ultros/src/web.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ultros/src/web.rs b/ultros/src/web.rs index f16d8e43..160ad5c0 100644 --- a/ultros/src/web.rs +++ b/ultros/src/web.rs @@ -816,6 +816,10 @@ async fn detect_region(region: Option) -> Region { region.unwrap_or(Region::NorthAmerica) } +async fn listings_redirect(Path((world, id)): Path<(String, i32)>) -> Redirect { + Redirect::permanent(&format!("/item/{world}/{id}")) +} + pub(crate) async fn start_web(state: WebState) { // build our application with a route let app = Router::new() @@ -884,6 +888,7 @@ pub(crate) async fn start_web(state: WebState) { .route("/sitemap/items.xml", get(item_sitemap)) .route("/sitemap.xml", get(sitemap_index)) .route("/sitemap/pages.xml", get(generic_pages_sitemap)) + .route("/listings/:world/:item", get(listings_redirect)) .nest( "/", create_leptos_app(state.world_helper.clone()).await.unwrap(),