added rust api to control DESI data distribution; updated to utilize bun for renovate
CI / Unit tests (pull_request) Failing after 8m55s
CI / Unit tests (pull_request) Failing after 8m55s
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
use desi_explorer_api::{config, routes};
|
||||
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(
|
||||
EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| EnvFilter::new("desi_explorer_api=info")),
|
||||
)
|
||||
.init();
|
||||
|
||||
let config = config::Config::from_env()?;
|
||||
let app = routes::app();
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(&config.bind_addr).await?;
|
||||
tracing::info!("DESI Explorer API listening on {}", config.bind_addr);
|
||||
|
||||
axum::serve(listener, app)
|
||||
.with_graceful_shutdown(shutdown_signal())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn shutdown_signal() {
|
||||
let _ = tokio::signal::ctrl_c().await;
|
||||
tracing::info!("shutting down");
|
||||
}
|
||||
Reference in New Issue
Block a user