tangled
alpha
login
or
join now
silvernskye.bsky.social
/
test-deploy
1
fork
atom
testing deployment to web
1
fork
atom
overview
issues
pulls
pipelines
add env properly
Silvern Skye
5 months ago
f8a18800
81d80e11
+7
-3
1 changed file
expand all
collapse all
unified
split
main.go
+7
-3
main.go
···
9
9
var testEnv string
10
10
11
11
func main() {
12
12
-
portNum := "8080"
13
13
-
os.Getenv("TEST_ENV")
12
12
+
portNum := os.Getenv("PORT")
13
13
+
if portNum == "" {
14
14
+
portNum = "8080"
15
15
+
}
16
16
+
17
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
19
-
http.ListenAndServe(":"+portNum, mux)
23
23
+
http.ListenAndServe("0.0.0.0:"+portNum, mux)
20
24
}
21
25
22
26
func handleRoot(w http.ResponseWriter, r *http.Request) {