Skip to content

Commit

Permalink
Finish basic http server
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryLuTW committed Oct 17, 2018
1 parent 9339eb9 commit 5cbf8f3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions main.go
@@ -0,0 +1,17 @@
package main

import (
"net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World"))
}

func main() {
http.HandleFunc("/", handler)
err := http.ListenAndServe(":8080", nil)
if err != nil {
panic(err)
}
}

0 comments on commit 5cbf8f3

Please sign in to comment.