Skip to content

Commit

Permalink
enh: adds health check api
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypalmudaliyar24 committed Jul 1, 2024
1 parent fe19d2c commit d0e2cc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/url_shortner/src/domain/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ use actix_web::web::ServiceConfig;
pub fn handler(config: &mut ServiceConfig) {
config
.service(internal::crud::generate_url)
.service(public_api::health_check)
.service(public_api::redirect_to_url);
}
5 changes: 5 additions & 0 deletions crates/url_shortner/src/domain/api/public_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ async fn redirect_to_url(
let url_short_code = UrlShortCode(path.into_inner());
public_api::redirect_to_url(app_state, url_short_code).await
}

#[get("/healthCheck")]
async fn health_check() -> Result<String, AppError> {
Ok("Service is Up".to_string())
}

0 comments on commit d0e2cc5

Please sign in to comment.