Files
flux-releaser/crates/flux-releaser/src/cli/server.rs
kjuulh d35f5c8f22
Some checks failed
continuous-integration/drone/push Build is failing
feat: add actual upload
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-02-19 22:50:49 +01:00

30 lines
580 B
Rust

use std::net::SocketAddr;
use crate::{
api::axum_serve,
app::{App, SharedApp},
grpc::tonic_serve,
};
pub async fn run_server(
host: impl Into<SocketAddr>,
grpc_host: impl Into<SocketAddr>,
) -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
tracing::info!("Starting service");
let app = SharedApp::new(App::new().await?);
tokio::select! {
res = axum_serve(host.into(), app.clone()) => {
res?;
},
res = tonic_serve(grpc_host.into(), app.clone()) => {
res?;
},
};
Ok(())
}