steid

@jamesgill /

steid/src/main.rs
515 BCode·Blame·Raw
1use steid::{application::AppConfig, infrastructure};
2use topcoat::router::{Router, RouterBuilderDiscoverExt};
3
4#[tokio::main]
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 dotenvy::dotenv().ok();
7
8 let config = AppConfig::from_env()?;
9 let pool = infrastructure::database::connect(&config.database_url).await?;
10
11 let router = Router::builder()
12 .discover()
13 .app_context(config)
14 .app_context(pool)
15 .build();
16
17 topcoat::start(router).await?;
18
19 Ok(())
20}