Created
August 2, 2022 05:58
-
-
Save percybolmer/b487b1cb99b073bd29e27041385c5bf1 to your computer and use it in GitHub Desktop.
Simple http server to use while learning docker
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "hello gopher") | |
}) | |
http.HandleFunc("/aligator", func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Hi Mr Aligator") | |
}) | |
log.Fatal(http.ListenAndServe(":8080", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment