Last active
September 20, 2020 17:09
-
-
Save nwillc/48a4e202f56d97f02215246b9049e92a to your computer and use it in GitHub Desktop.
A silly Go main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"time" | |
) | |
func main() { | |
msg := os.Getenv("CONFIG_MESSAGE") | |
go func() { | |
for { | |
time.Sleep(5 * time.Second) | |
log.Println(msg) | |
} | |
}() | |
http.HandleFunc("/", handler) | |
log.Fatal(http.ListenAndServe(":8888", nil)) | |
} | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintln(w, "ACK") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment