From 4299aaaeaf01d4b07cf2bcc05970ce6ebd5840c2 Mon Sep 17 00:00:00 2001 From: Ryan Daum Date: Tue, 14 Jan 2025 20:48:54 -0500 Subject: [PATCH] Fix route setup for new version of axum --- crates/web-host/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/web-host/src/main.rs b/crates/web-host/src/main.rs index c40a54b3..073a9be0 100644 --- a/crates/web-host/src/main.rs +++ b/crates/web-host/src/main.rs @@ -185,11 +185,11 @@ impl Listener { fn mk_routes(web_host: WebHost) -> eyre::Result { let webhost_router = Router::new() .route( - "/ws/attach/connect/:token", + "/ws/attach/connect/{token}", get(host::ws_connect_attach_handler), ) .route( - "/ws/attach/create/:token", + "/ws/attach/create/{token}", get(host::ws_create_attach_handler), ) .route("/", get(root_handler)) @@ -203,18 +203,18 @@ fn mk_routes(web_host: WebHost) -> eyre::Result { .route("/welcome", get(host::welcome_message_handler)) .route("/eval", post(host::eval_handler)) .route("/verbs", get(host::verbs_handler)) - .route("/verbs/:object/:name", get(host::verb_retrieval_handler)) - .route("/verbs/:object/:name", post(host::verb_program_handler)) + .route("/verbs/{object}/{name}", get(host::verb_retrieval_handler)) + .route("/verbs/{object}/{name}", post(host::verb_program_handler)) .route("/properties", get(host::properties_handler)) // ?oid=1234 or ?sysobj=foo.bar.baz or ?match=foo - .route("/objects/:object", get(host::resolve_objref_handler)) + .route("/objects/{object}", get(host::resolve_objref_handler)) .route( - "/properties/:object/:name", + "/properties/{object}/{name}", get(host::property_retrieval_handler), ) .with_state(web_host); - Ok(Router::new().nest("/", webhost_router)) + Ok(webhost_router) } #[tokio::main(flavor = "multi_thread")]