소스 검색

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

SVI 2 년 전
부모
커밋
c6ee02025d
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  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)
 	}
 }