Created
January 20, 2024 20:11
-
-
Save cheikhsimsol/c59ae1211a02c50de13bd939b502a9c7 to your computer and use it in GitHub Desktop.
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
mux := http.NewServeMux() | |
// Map a route to handle requests to the root path ("/") | |
mux.HandleFunc("GET 127.0.0.1/", func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "Hello") | |
}) | |
mux.HandleFunc("GET localhost/", func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "Bonjour") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment