steid

@jamesgill /

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