18 lines
274 B
Rust
18 lines
274 B
Rust
use std::env;
|
|
|
|
use dotenvy::dotenv;
|
|
|
|
#[derive(Debug)]
|
|
pub struct Config {
|
|
pub db_url: String,
|
|
}
|
|
|
|
impl Config {
|
|
pub fn load() -> Self {
|
|
dotenv().ok();
|
|
Self {
|
|
db_url: env::var("DB_URL").expect("DB_URL is not configured"),
|
|
}
|
|
}
|
|
}
|