From ef1be6ff2a7a253e70f19ac10743f8fba3694863 Mon Sep 17 00:00:00 2001 From: Levi Olson Date: Wed, 9 May 2018 14:32:20 -0500 Subject: [PATCH] Step 2 --- main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 1e47927..05994c1 100644 --- a/main.go +++ b/main.go @@ -2,9 +2,15 @@ package main import ( "fmt" - _ "net/http" + "log" + "net/http" ) func main() { - fmt.Println("Hello HTTP") + http.HandleFunc("/hello", HelloHTTP) + log.Fatal(http.ListenAndServe(":8080", nil)) +} + +func HelloHTTP(w http.ResponseWriter, req *http.Request) { + fmt.Fprint(w, "Hello HTTP") }