and now we have .env file support
This commit is contained in:
parent
f65d564c9c
commit
d00f530ed7
4 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue