From 8d8d82cda349ed0a5129ad18da3915eff8f1fa46 Mon Sep 17 00:00:00 2001 From: Tyrone Faulhaber <20131658+spectrapulse@users.noreply.github.com> Date: Mon, 27 May 2024 02:53:25 +0200 Subject: [PATCH] Update main.rs --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.rs b/src/main.rs index 9128d3e..29559a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -147,6 +147,13 @@ async fn index(req: HttpRequest) -> Result> { return Ok(response.finish()); } + // HealthCheck + if req.method() == Method::GET && req.path().eq("/ping") { + let mut response = HttpResponse::Ok(); + add_headers(&mut response); + return Ok(response.finish()); + } + // parse query string let mut query = QString::from(req.query_string());