steid

@jamesgill /

steid/src/main.rs
515 BCode·Blame·Raw
1e1ae56feat: identity domain model1mo
1use steid::{application::AppConfig, infrastructure};
0d12f7dfeat: config from env and SQLite pool in app context1mo
2use topcoat::router::{Router, RouterBuilderDiscoverExt};
e6f4874feat: topcoat skeleton serving a page1mo
3
4#[tokio::main]
0d12f7dfeat: config from env and SQLite pool in app context1mo
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 dotenvy::dotenv().ok();
e6f4874feat: topcoat skeleton serving a page1mo
7
0d12f7dfeat: config from env and SQLite pool in app context1mo
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?;
e6f4874feat: topcoat skeleton serving a page1mo
18
0d12f7dfeat: config from env and SQLite pool in app context1mo
19 Ok(())
1111df1feat: init1mo
20}