Consolidate to single .env file in project root

This commit is contained in:
Christoph Haas 2026-03-23 21:35:36 +01:00
parent b76ea568ae
commit f48d5631e7
2 changed files with 1 additions and 19 deletions

View file

@ -1,13 +0,0 @@
DB_HOST=localhost
DB_PORT=3306
DB_USER=mailadmin
DB_PASSWORD=your-db-password
DB_NAME=mailserver
JWT_SECRET=change-this-secret-in-production
SMTP_HOST=localhost
SMTP_PORT=587
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM=noreply@localhost
BASE_URL=http://localhost:8080

View file

@ -62,12 +62,7 @@ func Load() *Config {
// Load .env file if it exists.
// This is for local development convenience.
// In production, use environment variables directly.
// Try multiple locations: current dir, backend/.env, ../backend/.env
if err := godotenv.Load(".env"); err != nil {
if err := godotenv.Load("backend/.env"); err != nil {
godotenv.Load("../backend/.env")
}
}
godotenv.Load(".env")
// Return a new Config struct with all values.
// getEnv(key, default) returns the environment variable value,