From 4b05de25ae5f1e7b47ca2942d373a59d32f09f81 Mon Sep 17 00:00:00 2001 From: Chris Grass Date: Fri, 23 Feb 2024 05:09:38 -0500 Subject: [PATCH] fix: add routes data to actix app (#263) --- crates/server/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/server/src/lib.rs b/crates/server/src/lib.rs index 586ed6c..47550bc 100644 --- a/crates/server/src/lib.rs +++ b/crates/server/src/lib.rs @@ -83,6 +83,7 @@ pub async fn serve(serve_options: ServeOptions) -> Result { let server = HttpServer::new(move || { // Initializes the app data for handlers let app_data: Data = Data::new(serve_options.clone().into()); + let routes_data: Data = Data::new(app_data.routes.clone()); let mut app = App::new() // enable logger @@ -90,6 +91,7 @@ pub async fn serve(serve_options: ServeOptions) -> Result { // Clean path before sending it to the service .wrap(middleware::NormalizePath::trim()) .app_data(Data::clone(&app_data)) + .app_data(Data::clone(&routes_data)) .app_data(Data::clone(&data_connectors)); // Configure panel