Explorar o código

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

SVI %!s(int64=2) %!d(string=hai) anos
pai
achega
c6ee02025d
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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)
 	}
 }