Skip to content

Commit

Permalink
fix: adds health_check fn and endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tuddman committed Jun 27, 2024
1 parent 81523bb commit ccf0865
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)))
})
Expand Down

0 comments on commit ccf0865

Please sign in to comment.