package main import ( "log" "net/http" "os" ) func main() { port := os.Getenv("PORT") if port == "" { port = "8080" log.Printf("Defaulting to port %s \n", port) } http.HandleFunc("/", handleRoot) http.HandleFunc("/clicked", handleClicked) if err := http.ListenAndServe(":"+port, nil); err != nil { log.Fatal(err) } }