Last active
June 5, 2017 22:17
-
-
Save nstogner/ada81a624428d17077a81fbf4e20a421 to your computer and use it in GitHub Desktop.
Go: HTTP Status Logging Middleware Usage
This file contains hidden or 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 main() { | |
http.ListenAndServe(":8080", | |
logware( | |
http.HandlerFunc(handle), | |
), | |
) | |
} | |
func handle(w http.ResponseWriter, r *http.Request) { | |
w.WriteHeader(201) | |
w.Write([]byte("Accepted")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment