segrete rest from tera
This commit is contained in:
parent
9fbcffa2ea
commit
cf6db88b25
@ -14,10 +14,15 @@ async fn rocket() -> _ {
|
|||||||
|
|
||||||
let mut connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap();
|
let mut connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap();
|
||||||
connection_options.log_statements(log::LevelFilter::Debug);
|
connection_options.log_statements(log::LevelFilter::Debug);
|
||||||
let pool = PoolOptions::new()
|
let db: SqlitePool = PoolOptions::new()
|
||||||
.connect_with(connection_options)
|
.connect_with(connection_options)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
tera::start(pool)
|
let rocket = rocket::build().manage(db);
|
||||||
|
|
||||||
|
#[cfg(feature = "rowing-tera")]
|
||||||
|
let rocket = tera::config(rocket);
|
||||||
|
|
||||||
|
rocket
|
||||||
}
|
}
|
||||||
|
@ -110,9 +110,8 @@ pub struct Config {
|
|||||||
rss_key: String,
|
rss_key: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start(db: SqlitePool) -> Rocket<Build> {
|
pub fn config(rocket: Rocket<Build>) -> Rocket<Build> {
|
||||||
rocket::build()
|
rocket
|
||||||
.manage(db)
|
|
||||||
.mount("/", routes![index, join, remove])
|
.mount("/", routes![index, join, remove])
|
||||||
.mount("/auth", auth::routes())
|
.mount("/auth", auth::routes())
|
||||||
.mount("/cox", cox::routes())
|
.mount("/cox", cox::routes())
|
||||||
|
Loading…
Reference in New Issue
Block a user