Closed stiiifff closed 3 years ago
I am trying to use the middleware within a scope e.g.
App::new() .service( web::scope("/internal") .wrap(prometheus.clone()) .service(web::resource("/").to(|| HttpResponse::Ok())), ) .service(web::resource("/").to(|| HttpResponse::Ok()))
and I'm getting the following error:
error[E0271]: type mismatch resolving `<PrometheusMetrics as Transform<actix_web::scope::ScopeService>>::Response == ServiceResponse` --> src/main.rs:11:22 | 11 | .wrap(prometheus.clone()) | ^^^^ expected struct `StreamLog`, found enum `actix_web::dev::Body` | = note: expected struct `ServiceResponse<StreamLog<_>>` found struct `ServiceResponse<actix_web::dev::Body>`
I am trying to use the middleware within a scope e.g.
and I'm getting the following error: