diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index ba41b2d..01f6eed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,23 @@ +use rocket::routes; +use sqlx::PgPool; + mod jobs; +mod db; +mod api; -fn main() { +#[rocket::main] +async fn main() -> Result<(), rocket::Error> { println!("{}_{} starting up", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); - jobs::startup::run_startup_jobs(); + + jobs::startup::run_startup_jobs().await; + + let db_pool = PgPool::connect("postgres://localhost/photoxide").await.unwrap(); + + let _rocket = rocket::build() + .manage(db_pool) + .mount("/", routes![api::routes::test::testroute]) + .launch() + .await?; + + Ok(()) } |