Skip to content

Commit

Permalink
Implement health_check api
Browse files Browse the repository at this point in the history
  • Loading branch information
ftassi committed Sep 11, 2023
1 parent 28715d7 commit 2ff9439
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
fn main() {
println!("Hello, world!");
use actix_web::{get, App, HttpServer, Responder, HttpResponse};

#[get("/health_check")]
async fn health_check() -> impl Responder {
HttpResponse::Ok()
}

#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
HttpServer::new(|| {
App::new()
.service(health_check)
})
.bind("127.0.0.1:8000")?
.run()
.await
}

0 comments on commit 2ff9439

Please sign in to comment.