Skip to content

Commit

Permalink
add healthcheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Wójcik committed Aug 11, 2023
1 parent 0e3bfd5 commit 597fdcb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ async fn app_info() -> ApiResult<Json<AppInfo>> {
Ok(Json(AppInfo { version }))
}

async fn healthcheck() -> &'static str {
"I'm alive!"
}

pub async fn run_server(config: Config) -> anyhow::Result<()> {
info!("Starting Defguard proxy server");

Expand Down Expand Up @@ -78,6 +82,7 @@ pub async fn run_server(config: Config) -> anyhow::Result<()> {
"/api/v1",
Router::new()
.nest("/enrollment", enrollment::router())
.route("/health", get(healthcheck))
.route("/info", get(app_info)),
)
.nest_service("/svg", serve_images)
Expand Down

0 comments on commit 597fdcb

Please sign in to comment.