diff --git a/Makefile b/Makefile index ead1040..b3b6ba2 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ dev-frontend: dev-backend: @echo "Starting backend dev server..." - USE_EMBEDDED=false go run ./$(BACKEND_DIR)/cmd/server + cd $(BACKEND_DIR) && USE_EMBEDDED=false go run ./cmd/server # Clean build artifacts clean: diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index fca5c25..bb2268b 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -62,7 +62,10 @@ func Load() *Config { // Load .env file if it exists. // This is for local development convenience. // In production, use environment variables directly. - godotenv.Load(".env") + // Try current dir first, then parent (for when running from backend/). + if err := godotenv.Load(".env"); err != nil { + godotenv.Load("../.env") + } // Return a new Config struct with all values. // getEnv(key, default) returns the environment variable value,