Explorar el Código

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

SVI hace 2 años
padre
commit
c6ee02025d
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      cmd/server/main.go

+ 6 - 1
cmd/server/main.go

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