Skip to content

Instantly share code, notes, and snippets.

@nosequeldeebee
Created January 29, 2018 06:05
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 nosequeldeebee/d8a4b5e705d1c5fe14531ad1c89ee12a to your computer and use it in GitHub Desktop.
Save nosequeldeebee/d8a4b5e705d1c5fe14531ad1c89ee12a to your computer and use it in GitHub Desktop.
func handleGetBlockchain(w http.ResponseWriter, r *http.Request) {
bytes, err := json.MarshalIndent(Blockchain, "", " ")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
io.WriteString(w, string(bytes))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment