summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 15d28e9..7d2b643 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -23,6 +23,10 @@ fn error_content_language<B>(
#[actix_web::main]
async fn main() -> Result<(), RawUnexpected> {
+ // load the environment file, but only in debug mode
+ #[cfg(debug_assertions)]
+ dotenv::dotenv()?;
+
// initialize the database
let db_url = secrets::database_url()?;
let sql_pool = db::initialize(&db_url).await?;
@@ -31,7 +35,7 @@ async fn main() -> Result<(), RawUnexpected> {
HttpServer::new(move || {
App::new()
.wrap(ErrorHandlers::new().default_handler(error_content_language))
- .wrap(Logger::new("[%t] \"%r\" %s %Dms"))
+ .wrap(Logger::new("\"%r\" %s %Dms"))
.app_data(Data::new(sql_pool.clone()))
.service(api::liveops())
.service(api::users())