diff --git a/app/http_server_common/src/endpoints/root_index.rs b/app/http_server_common/src/endpoints/root_index.rs index bfab8f441f..415b514186 100644 --- a/app/http_server_common/src/endpoints/root_index.rs +++ b/app/http_server_common/src/endpoints/root_index.rs @@ -2,7 +2,16 @@ use actix_http::http::StatusCode; use actix_web::{HttpResponse, HttpRequest, Responder, get}; use log::debug; -#[get("/")] + +/* +error[E0277]: the trait bound `fn() -> impl futures::Future {get_root_index}: HttpServiceFactory` is not satisfied + --> app/storyteller_web/src/main.rs:627:16 + | +627 | .service(get_root_index) + | ^^^^^^^^^^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl futures::Future {get_root_index}` + */ + + pub async fn get_root_index() -> impl Responder { debug!("GET /"); // NB: Google load balancer hits this a lot, and it spams. HttpResponse::build(StatusCode::OK) diff --git a/app/obs_gateway/src/main.rs b/app/obs_gateway/src/main.rs index d1a2672ec5..a2485b7a3c 100644 --- a/app/obs_gateway/src/main.rs +++ b/app/obs_gateway/src/main.rs @@ -31,7 +31,7 @@ use crate::twitch::twitch_secrets::TwitchSecrets; use crate::twitch::websocket_client::PollingTwitchWebsocketClient; use futures::Future; use futures::executor::ThreadPool; -//use http_server_common::cors::build_common_cors_config; +use http_server_common::cors::build_common_cors_config; use http_server_common::endpoints::default_route_404::default_route_404; use http_server_common::endpoints::root_index::get_root_index; use limitation::Limiter; @@ -308,7 +308,7 @@ pub async fn serve(server_state: ObsGatewayServerState) -> AnyhowResult<()> HttpServer::new(move || { App::new() .app_data(server_state_arc.clone()) - //.wrap(build_common_cors_config()) + .wrap(build_common_cors_config()) .wrap(Logger::new(&log_format) .exclude("/liveness") .exclude("/readiness")) diff --git a/app/storyteller_web/src/main.rs b/app/storyteller_web/src/main.rs index b5a809d07c..23ede7aabf 100644 --- a/app/storyteller_web/src/main.rs +++ b/app/storyteller_web/src/main.rs @@ -624,10 +624,10 @@ pub async fn serve(server_state: ServerState) -> AnyhowResult<()> .route(web::get().to(leaderboard_handler)) .route(web::head().to(|| HttpResponse::Ok())) ) - .service(get_root_index) + //.service(get_root_index) .service(enable_alpha_handler) .service(enable_alpha_easy_handler) - .default_service( web::route().to(default_route_404)) + //.default_service( web::route().to(default_route_404)) }) .bind(bind_address)? .workers(num_workers)