testing deployment to web

add env properly

+7 -3
+7 -3
main.go
··· 9 9 var testEnv string 10 10 11 11 func main() { 12 - portNum := "8080" 13 - os.Getenv("TEST_ENV") 12 + portNum := os.Getenv("PORT") 13 + if portNum == "" { 14 + portNum = "8080" 15 + } 16 + 17 + testEnv = os.Getenv("TEST_ENV") 14 18 15 19 mux := http.NewServeMux() 16 20 mux.HandleFunc("/", handleRoot) 17 21 18 22 fmt.Println("server listening to " + portNum) 19 - http.ListenAndServe(":"+portNum, mux) 23 + http.ListenAndServe("0.0.0.0:"+portNum, mux) 20 24 } 21 25 22 26 func handleRoot(w http.ResponseWriter, r *http.Request) {