Add dotenvy
This commit is contained in:
parent
fff5e1a1a0
commit
95dc6ebd61
@ -15,6 +15,7 @@ base64 = "0.21.2"
|
|||||||
bcrypt = "0.14.0"
|
bcrypt = "0.14.0"
|
||||||
colored = "2.0.0"
|
colored = "2.0.0"
|
||||||
dialoguer = { version = "0.10.4", default-features = false, features = ["password"] }
|
dialoguer = { version = "0.10.4", default-features = false, features = ["password"] }
|
||||||
|
dotenvy = "0.15.7"
|
||||||
driftwood = "0.0.7"
|
driftwood = "0.0.7"
|
||||||
femme = "2.2.1"
|
femme = "2.2.1"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#![feature(fs_try_exists)]
|
#![feature(fs_try_exists)]
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
|
use dotenvy::dotenv;
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use log::LevelFilter::Debug;
|
use log::LevelFilter::Debug;
|
||||||
|
|
||||||
@ -21,6 +22,8 @@ mod server;
|
|||||||
|
|
||||||
#[async_std::main]
|
#[async_std::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
|
let _ = dotenv();
|
||||||
|
|
||||||
// Early catch
|
// Early catch
|
||||||
if std::env::var("DATABASE_URL").is_err() {
|
if std::env::var("DATABASE_URL").is_err() {
|
||||||
bail!("DATABASE_URL needs to be set.")
|
bail!("DATABASE_URL needs to be set.")
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
#![feature(fs_try_exists)]
|
#![feature(fs_try_exists)]
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
use log::{debug, error, info, log, trace, warn};
|
use dotenvy::dotenv;
|
||||||
|
use log::error;
|
||||||
use log::LevelFilter::{Debug, Info};
|
use log::LevelFilter::{Debug, Info};
|
||||||
|
|
||||||
use yggdrasil::*;
|
use yggdrasil::*;
|
||||||
@ -22,6 +23,8 @@ mod dbtool;
|
|||||||
|
|
||||||
#[async_std::main]
|
#[async_std::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
|
let _ = dotenv();
|
||||||
|
|
||||||
// Early catch
|
// Early catch
|
||||||
if std::env::var("DATABASE_URL").is_err() {
|
if std::env::var("DATABASE_URL").is_err() {
|
||||||
bail!("DATABASE_URL needs to be set.")
|
bail!("DATABASE_URL needs to be set.")
|
||||||
|
Loading…
Reference in New Issue
Block a user