blob: 01f6eed1274fbe1c0a4d42b9f12e9ee3593b5cd8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
use rocket::routes;
use sqlx::PgPool;
mod jobs;
mod db;
mod api;
#[rocket::main]
async fn main() -> Result<(), rocket::Error> {
println!("{}_{} starting up", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
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(())
}
|