From 1e9a769e5e4af4684967473f0844f66c3958432c Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 18 Jun 2025 17:50:51 -0600 Subject: feat: register the health check service and the reflection service --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index f84dc08e..5af58aa0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,9 +34,19 @@ impl Authorization for PolicyServer { #[tokio::main] async fn main() -> Result<(), Box> { let addr = "[::1]:50051".parse()?; - + let (health_reporter, health_service) = tonic_health::server::health_reporter(); + health_reporter + .set_serving::>() + .await; + + let reflection_service = tonic_reflection::server::Builder::configure() + .register_encoded_file_descriptor_set(tonic_health::pb::FILE_DESCRIPTOR_SET) + .build_v1() + .unwrap(); Server::builder() + .add_service(health_service) .add_service(AuthorizationServer::new(PolicyServer::default())) + .add_service(reflection_service) .serve(addr) .await?; -- cgit v1.2.3