Skip to content

Instantly share code, notes, and snippets.

@nwillc
Last active September 20, 2020 17:09
Show Gist options
  • Save nwillc/48a4e202f56d97f02215246b9049e92a to your computer and use it in GitHub Desktop.
Save nwillc/48a4e202f56d97f02215246b9049e92a to your computer and use it in GitHub Desktop.
A silly Go main
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