Last active
April 30, 2020 11:51
-
-
Save antonyh/ef654bd481d5f0f0612346fe68e11867 to your computer and use it in GitHub Desktop.
Simple HTTP server in Golang to echo back request URI for debugging other things (such as HTTPd rewrite rules)
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) { | |
log.Printf(r.RequestURI) | |
fmt.Fprintf(w, "%s\n", r.RequestURI) | |
}) | |
http.ListenAndServe(":8080", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment