Skip to content

Instantly share code, notes, and snippets.

@tjmaynes
Created October 12, 2021 18:12
Show Gist options
  • Save tjmaynes/4e0f97757e2161a4aaf2b594d02f27a7 to your computer and use it in GitHub Desktop.
Save tjmaynes/4e0f97757e2161a4aaf2b594d02f27a7 to your computer and use it in GitHub Desktop.
...
if is_database_connected {
HttpResponse::Ok()
.content_type("application/json")
.body(serde_json::json!({ "database_connected": is_database_connected }).to_string())
} else {
HttpResponse::ServiceUnavailable()
.content_type("application/json")
.body(serde_json::json!({ "database_connected": is_database_connected }).to_string())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment