forked from coracle/caravel
Add dotenv
This commit is contained in:
@@ -20,13 +20,13 @@ pub struct Config {
|
||||
impl Config {
|
||||
pub fn from_env() -> Self {
|
||||
let database_url =
|
||||
env::var("DATABASE_URL").unwrap_or_else(|_| "sqlite://data/hosting.db".to_string());
|
||||
env::var("DATABASE_URL").unwrap_or_else(|_| "sqlite://data/caravel.db".to_string());
|
||||
let host = env::var("HOST").unwrap_or_else(|_| "127.0.0.1".to_string());
|
||||
let port = env::var("PORT")
|
||||
.ok()
|
||||
.and_then(|v| v.parse().ok())
|
||||
.unwrap_or(3000);
|
||||
let admin_pubkeys = env::var("HOSTING_ADMIN_PUBKEYS")
|
||||
let admin_pubkeys = env::var("PLATFORM_ADMIN_PUBKEYS")
|
||||
.unwrap_or_default()
|
||||
.split(',')
|
||||
.map(|v| v.trim().to_string())
|
||||
|
||||
@@ -27,6 +27,8 @@ use crate::repo::Repo;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
dotenvy::dotenv().ok();
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(tracing_subscriber::EnvFilter::from_default_env())
|
||||
.with(tracing_subscriber::fmt::layer())
|
||||
|
||||
Reference in New Issue
Block a user