This commit is contained in:
cdricms
2025-01-14 14:37:50 +01:00
parent 8aadc810d1
commit 8f89f236e7
4 changed files with 28 additions and 1 deletions

View File

@@ -18,7 +18,12 @@ func main() {
if err != nil {
log.Fatalf("Error loading .env file: %v", err)
}
environ := os.Getenv("ENVIRONMENT")
port := os.Getenv("BACKEND_DOCKER_PORT")
if environ == "DEV" {
port = os.Getenv("BACKEND_PORT")
}
http.HandleFunc("/", handler)
fmt.Printf("Serving on port %s\n", port)
err = http.ListenAndServe(fmt.Sprintf(":%s", port), nil)