diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 11 insertions, 1 deletions
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<dyn std::error::Error>> { let addr = "[::1]:50051".parse()?; - + let (health_reporter, health_service) = tonic_health::server::health_reporter(); + health_reporter + .set_serving::<AuthorizationServer<PolicyServer>>() + .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?; |
