Consolidate to single .env file in project root
This commit is contained in:
parent
b76ea568ae
commit
f48d5631e7
2 changed files with 1 additions and 19 deletions
13
backend/.env
13
backend/.env
|
|
@ -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
|
|
||||||
|
|
@ -62,12 +62,7 @@ func Load() *Config {
|
||||||
// Load .env file if it exists.
|
// Load .env file if it exists.
|
||||||
// This is for local development convenience.
|
// This is for local development convenience.
|
||||||
// In production, use environment variables directly.
|
// In production, use environment variables directly.
|
||||||
// Try multiple locations: current dir, backend/.env, ../backend/.env
|
godotenv.Load(".env")
|
||||||
if err := godotenv.Load(".env"); err != nil {
|
|
||||||
if err := godotenv.Load("backend/.env"); err != nil {
|
|
||||||
godotenv.Load("../backend/.env")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return a new Config struct with all values.
|
// Return a new Config struct with all values.
|
||||||
// getEnv(key, default) returns the environment variable value,
|
// getEnv(key, default) returns the environment variable value,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue