diff main.go server.go --- main.go +++ server.go @@ -3,2 +3,7 @@ -import "fmt" - +import ( + "fmt" + "net/http" + "os" +) + +// sayHello greets whoever is passed in as an argument. @@ -9,0 +15,1 @@ + if os.Getenv("DEBUG") == "1" { @@ -10,0 +17,5 @@ + } + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(sayHello("internet"))) + }) + panic(http.ListenAndServe(":8080", nil))