24 lines
571 B
Rust
24 lines
571 B
Rust
use std::str::FromStr;
|
|
|
|
#[cfg(feature = "rowing-tera")]
|
|
use rot::tera;
|
|
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions};
|
|
|
|
#[macro_use]
|
|
extern crate rocket;
|
|
|
|
#[cfg(feature = "rowing-tera")]
|
|
#[launch]
|
|
async fn rocket() -> _ {
|
|
env_logger::init();
|
|
|
|
let mut connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap();
|
|
connection_options.log_statements(log::LevelFilter::Debug);
|
|
let pool = PoolOptions::new()
|
|
.connect_with(connection_options)
|
|
.await
|
|
.unwrap();
|
|
|
|
tera::start(pool)
|
|
}
|