From ccf08658ea9c6790fc596497316def868e6ffbca Mon Sep 17 00:00:00 2001 From: tuddman Date: Thu, 27 Jun 2024 22:04:30 +0200 Subject: [PATCH] fix: adds health_check fn and endpoint --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index eefdefd..561a53b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -122,6 +122,11 @@ fn verify_hmac( } } + +async fn health_check() -> impl Responder { + HttpResponse::Ok().finish() +} + #[actix_web::main] async fn main() -> std::io::Result<()> { std::fs::create_dir_all("uploads").unwrap(); @@ -130,6 +135,7 @@ async fn main() -> std::io::Result<()> { println!("Starting server at: {}", host); HttpServer::new(move || { App::new() + .route("/", web::get().to(health_check)) .service(web::resource("/upload").route(web::post().to(upload_file))) .service(web::resource("/files/{id}").route(web::get().to(get_file))) })