and now we have .env file support

This commit is contained in:
Erin 2024-04-15 03:40:28 -04:00
parent f65d564c9c
commit d00f530ed7
Signed by: erin
SSH key fingerprint: SHA256:clvLPaxKthBet+VUQTKQdDkjaqg2/KnYHQaPASp5pFE
4 changed files with 10 additions and 0 deletions

View file

@ -112,6 +112,7 @@ async fn add(
#[rocket::launch]
async fn rocket() -> _ {
dotenv::dotenv().ok();
let db_url = env::var("DATABASE_URL").expect("DATABASE_URL is required");
let pool = SqlitePool::connect(&db_url)
.await