rowt/src/main.rs
2023-04-13 08:15:55 +02:00

23 lines
572 B
Rust

use std::str::FromStr;
use rot::rest;
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions};
#[macro_use]
extern crate rocket;
#[launch]
async fn rocket() -> _ {
env_logger::init();
//let pool = SqlitePool::connect(":memory:").await.unwrap();
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();
rest::start(pool)
}