diff --git a/src/main.rs b/src/main.rs index 93542de..ba95c4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,10 +14,15 @@ async fn rocket() -> _ { let mut connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap(); connection_options.log_statements(log::LevelFilter::Debug); - let pool = PoolOptions::new() + let db: SqlitePool = PoolOptions::new() .connect_with(connection_options) .await .unwrap(); - tera::start(pool) + let rocket = rocket::build().manage(db); + + #[cfg(feature = "rowing-tera")] + let rocket = tera::config(rocket); + + rocket } diff --git a/src/tera/mod.rs b/src/tera/mod.rs index 4df1f31..7a4e6bc 100644 --- a/src/tera/mod.rs +++ b/src/tera/mod.rs @@ -110,9 +110,8 @@ pub struct Config { rss_key: String, } -pub fn start(db: SqlitePool) -> Rocket { - rocket::build() - .manage(db) +pub fn config(rocket: Rocket) -> Rocket { + rocket .mount("/", routes![index, join, remove]) .mount("/auth", auth::routes()) .mount("/cox", cox::routes())