summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAshelyn Rose <git@ashen.earth>2024-10-26 02:20:32 -0400
committerAshelyn Rose <git@ashen.earth>2024-10-26 02:20:32 -0400
commit130669793dfb77b286a26a373378b4d1f2be837c (patch)
treeb2867473b4610e3f79c3098bf661435c25fcee5c /src/main.rs
parent2eee33d2a2042b209dd5f9ef4b7314ea81a33360 (diff)
Very basic rocket db state and session lookup (with hardcoded session id)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs21
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(())
 }