churn-v2/crates/churn/src/server.rs
kjuulh ee323e99e8
All checks were successful
continuous-integration/drone/push Build is passing
feat: add discovery
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-24 17:12:15 +01:00

24 lines
480 B
Rust

use std::net::SocketAddr;
pub mod config;
mod grpc_server;
use crate::{api, state::SharedState};
pub async fn execute(
host: impl Into<SocketAddr>,
grpc_host: impl Into<SocketAddr>,
config: config::ServerConfig,
) -> anyhow::Result<()> {
let state = SharedState::new(config).await?;
notmad::Mad::builder()
.add(api::Api::new(&state, host))
.add(grpc_server::GrpcServer::new(grpc_host.into()))
.run()
.await?;
Ok(())
}