summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index 917cace5..57f98b9a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,17 +7,18 @@ use authorization::CheckService;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "[::1]:50051".parse()?;
- let authorization_service = AuthorizationServer::new(CheckService::default());
+
let (_health_reporter, health_service) = tonic_health::server::health_reporter();
- 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(authorization_service)
+ .add_service(AuthorizationServer::new(CheckService::default()))
.add_service(health_service)
- .add_service(reflection_service)
+ .add_service(
+ tonic_reflection::server::Builder::configure()
+ .register_encoded_file_descriptor_set(tonic_health::pb::FILE_DESCRIPTOR_SET)
+ .build_v1()
+ .unwrap(),
+ )
.serve(addr)
.await?;