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();
|
||||
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
|
||||
}
|
||||
|
@ -110,9 +110,8 @@ pub struct Config {
|
||||
rss_key: String,
|
||||
}
|
||||
|
||||
pub fn start(db: SqlitePool) -> Rocket<Build> {
|
||||
rocket::build()
|
||||
.manage(db)
|
||||
pub fn config(rocket: Rocket<Build>) -> Rocket<Build> {
|
||||
rocket
|
||||
.mount("/", routes![index, join, remove])
|
||||
.mount("/auth", auth::routes())
|
||||
.mount("/cox", cox::routes())
|
||||
|
Loading…
Reference in New Issue
Block a user