refactor: stuff
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-02-10 22:13:59 +01:00
parent 9e9fbcd021
commit 445720c22c
2 changed files with 150 additions and 58 deletions

View File

@@ -26,19 +26,16 @@ async fn main() -> anyhow::Result<()> {
let cli = Command::parse();
match cli.command {
Some(Commands::Serve { host }) => {
tracing::info!("Starting service");
if let Some(Commands::Serve { host }) = cli.command {
tracing::info!("Starting service");
let app = Router::new().route("/", get(root));
let app = Router::new().route("/", get(root));
tracing::info!("listening on {}", host);
let listener = tokio::net::TcpListener::bind(host).await.unwrap();
axum::serve(listener, app.into_make_service())
.await
.unwrap();
}
None => {}
tracing::info!("listening on {}", host);
let listener = tokio::net::TcpListener::bind(host).await.unwrap();
axum::serve(listener, app.into_make_service())
.await
.unwrap();
}
Ok(())