Skip to content

Commit

Permalink
Adjust environment loading to use .env.local in local environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip-Petruneac committed Sep 13, 2024
1 parent b47acc7 commit a451535
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MYSQL_ROOT_PASSWORD=password
MYSQL_USER=filip
MYSQL_DATABASE=db
MYSQL_PASSWORD=password
MYSQL_PORT=4450
DB_HOSTNAME=localhost
API_URL=http://localhost:8081
2 changes: 1 addition & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func main() {
flag.Parse()

// Load environment variables from the .env file
err := godotenv.Load()
err := godotenv.Load("../.env.local")
if err != nil {
log.Println("No .env file found, continuing with environment variables or defaults")
}
Expand Down

0 comments on commit a451535

Please sign in to comment.