Skip to content

Commit ccf0865

Browse files
committed
fix: adds health_check fn and endpoint
1 parent 81523bb commit ccf0865

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.rs

+6
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ fn verify_hmac(
122122
}
123123
}
124124

125+
126+
async fn health_check() -> impl Responder {
127+
HttpResponse::Ok().finish()
128+
}
129+
125130
#[actix_web::main]
126131
async fn main() -> std::io::Result<()> {
127132
std::fs::create_dir_all("uploads").unwrap();
@@ -130,6 +135,7 @@ async fn main() -> std::io::Result<()> {
130135
println!("Starting server at: {}", host);
131136
HttpServer::new(move || {
132137
App::new()
138+
.route("/", web::get().to(health_check))
133139
.service(web::resource("/upload").route(web::post().to(upload_file)))
134140
.service(web::resource("/files/{id}").route(web::get().to(get_file)))
135141
})

0 commit comments

Comments
 (0)