Last active
December 16, 2021 17:44
-
-
Save vaguecoder/534560cddd711ae2c535809a00dd76ad to your computer and use it in GitHub Desktop.
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
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
jsonData, err = json.Marshal(data) | |
if err != nil { | |
// Handle Error | |
} | |
_, err = w.Write(jsonData) | |
if err != nil { | |
// Handle Error | |
} | |
}) | |
err = http.ListenAndServe(":8080", nil) | |
if err != nil { | |
// Handle Error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment