rowt/src/main.rs

24 lines
571 B
Rust
Raw Normal View History

2023-04-13 08:15:55 +02:00
use std::str::FromStr;
2023-06-28 14:06:28 +02:00
#[cfg(feature = "rowing-tera")]
use rot::tera;
2023-04-13 08:15:55 +02:00
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions};
2023-03-26 14:40:56 +02:00
2023-02-08 16:25:06 +01:00
#[macro_use]
extern crate rocket;
2023-06-28 14:06:28 +02:00
#[cfg(feature = "rowing-tera")]
2023-02-08 16:25:06 +01:00
#[launch]
async fn rocket() -> _ {
2023-03-04 11:20:12 +01:00
env_logger::init();
2023-03-26 14:40:56 +02:00
2023-04-13 08:15:55 +02:00
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();
2023-04-03 16:11:26 +02:00
2023-06-28 14:06:28 +02:00
tera::start(pool)
2023-02-08 16:25:06 +01:00
}