Skip to content

Commit

Permalink
Remove health fn
Browse files Browse the repository at this point in the history
  • Loading branch information
max-lt committed Mar 25, 2024
1 parent a574fb1 commit 918712c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,6 @@ async fn handle_request(data: Data<AppState>, req: HttpRequest, body: Bytes) ->
response
}

async fn health_check(req: HttpRequest) -> HttpResponse {
debug!(
"health_check of: {:?} {}",
req.connection_info(),
req.method()
);

HttpResponse::Ok().body("ok")
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenv::dotenv().ok();
Expand Down Expand Up @@ -247,8 +237,8 @@ async fn main() -> std::io::Result<()> {
.service(
web::resource("/health")
.guard(actix_web::guard::Header("host", "127.0.0.1:8080"))
.route(web::head().to(health_check))
.route(web::get().to(health_check)),
.route(web::head().to(HttpResponse::Ok))
.route(web::get().to(HttpResponse::Ok)),
)
.default_service(web::to(handle_request))
})
Expand Down

0 comments on commit 918712c

Please sign in to comment.