Skip to content

Instantly share code, notes, and snippets.

@losinggeneration
Created May 18, 2014 15:41
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 losinggeneration/2394ce1be49489f4f8c1 to your computer and use it in GitHub Desktop.
Save losinggeneration/2394ce1be49489f4f8c1 to your computer and use it in GitHub Desktop.
This is a fix to the muxchain kitten example in https://stephensearles.com/?p=254
func main() {
m := muxchainutil.NewMethodMux()
m.Handle("GET /kitten", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
f, _ := os.Open("kitten.jpg")
defer f.Close()
io.Copy(w, f)
}))
http.ListenAndServe(":3000", m)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment