Skip to content

Commit

Permalink
fix: add routes data to actix app (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-grass authored Feb 23, 2024
1 parent cac427d commit 4b05de2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ pub async fn serve(serve_options: ServeOptions) -> Result<Server> {
let server = HttpServer::new(move || {
// Initializes the app data for handlers
let app_data: Data<AppData> = Data::new(serve_options.clone().into());
let routes_data: Data<Routes> = Data::new(app_data.routes.clone());

let mut app = App::new()
// enable logger
.wrap(middleware::Logger::default())
// 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
Expand Down

0 comments on commit 4b05de2

Please sign in to comment.