Created
July 16, 2013 04:56
-
-
Save chris-piekarski/6005889 to your computer and use it in GitHub Desktop.
Serve up html page from Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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