feat: refactor files
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-02-11 13:49:14 +01:00
parent be8d605b6a
commit de1ff1b9a6
5 changed files with 145 additions and 82 deletions

View File

@@ -0,0 +1,20 @@
use std::net::SocketAddr;
use axum::{routing::get, Router};
use crate::app::SharedApp;
pub async fn axum_serve(host: SocketAddr, app: SharedApp) -> anyhow::Result<()> {
let app = Router::new().route("/", get(root)).with_state(app);
tracing::info!("listening on {}", host);
let listener = tokio::net::TcpListener::bind(host).await.unwrap();
axum::serve(listener, app.into_make_service()).await?;
Ok(())
}
async fn root() -> &'static str {
"Hello, flux-releaser!"
}