Browse Source

d04 Подкрутка под разные стенды

SVI 2 years ago
parent
commit
c6ee02025d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      cmd/server/main.go

+ 6 - 1
cmd/server/main.go

@@ -18,8 +18,13 @@ import (
 )
 
 func profile() {
+	port := "8080"
+	stage := os.Getenv("STAGE")
+	if stage == "local" {
+		port = "8081"
+	}
 	for {
-		http.ListenAndServe("0.0.0.0:8080", nil)
+		http.ListenAndServe("0.0.0.0:"+port, nil)
 	}
 }