diff --git a/gotime/src/exercise-http-handlers.go b/gotime/src/exercise-http-handlers.go new file mode 100644 index 0000000..f1f5062 --- /dev/null +++ b/gotime/src/exercise-http-handlers.go @@ -0,0 +1,9 @@ +package main + +import ( + "net/http" +) + +func main() { + http.ListenAndServe("localhost:4000", nil) +} diff --git a/gotime/src/hello-web.go b/gotime/src/hello-web.go new file mode 100644 index 0000000..e6856ae --- /dev/null +++ b/gotime/src/hello-web.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "net/http" +) + +type Hello struct{} + +func (h Hello) ServeHTTP( + w http.ResponseWriter, + r *http.Request) { + fmt.Fprint(w, "Hello!\n") +} + +func main() { + var h Hello + http.ListenAndServe("localhost:4000", h) +}