Skip to content

Instantly share code, notes, and snippets.

@chris-piekarski
Created July 16, 2013 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-piekarski/6005889 to your computer and use it in GitHub Desktop.
Save chris-piekarski/6005889 to your computer and use it in GitHub Desktop.
Serve up html page from Go
func goHandler(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
fmt.Print("Got a POST")
}
body, _ := ioutil.ReadFile("mag.html")
w.Write(body)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment