diff --git a/Cargo.toml b/Cargo.toml index 60d636d..321ded6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,4 +27,9 @@ hex = "0.4.3" macros = { path = "macros" } [build-dependencies] -tonic-build = "0.12.3" \ No newline at end of file +tonic-build = "0.12.3" + +[features] +default = ["secure", "auth"] +secure = [] +auth = [] \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 0454464..b2d7765 100644 --- a/src/main.rs +++ b/src/main.rs @@ -240,10 +240,16 @@ async fn start_secure_server() -> SecureServer{ } async fn start_servers(){ + + + #[cfg(feature = "auth")] let auth_server = start_auth_server().await; + #[cfg(feature = "secure")] let secure_server = start_secure_server().await; + #[cfg(feature = "auth")] auth_server.join_handle.await.expect("auth server crashed"); + #[cfg(feature = "secure")] secure_server.join_handle.await.expect("auth server crashed"); }