Function auth_lib::bootstrap_server
source · pub fn bootstrap_server(config: Option<Config>) -> impl AuthExpand description
Builds the server with the given configuration. If no configuration is given, it will use the default configuration.
Example
This is how the server can be started:
use auth_lib::cp_grpc::auth_server::AuthServer;
let server = bootstrap_server(Some(config));
let addr: std::net::SocketAddr = "[::1]:50051".parse()?;
// This is the ready-to-use grpc server
let grpc_server = AuthServer::new(server);
// Usable in a tonic server like this:
/*tonic::transport::Server::builder()
.add_service(AuthServer::new(server))
.serve(addr)
.await?;
*/