1e1ae56feat: identity domain model1mo | 1 | use steid::{application::AppConfig, infrastructure}; |
0d12f7dfeat: config from env and SQLite pool in app context1mo | 2 | use topcoat::router::{Router, RouterBuilderDiscoverExt}; |
e6f4874feat: topcoat skeleton serving a page1mo | 3 | |
| 4 | #[tokio::main] |
0d12f7dfeat: config from env and SQLite pool in app context1mo | 5 | async 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(()) |
| 20 | } |