Created
January 17, 2019 11:39
-
-
Save ksato9700/859329092470d8f4ccb4a6548bb7abae 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
log.Println("received request") | |
fmt.Fprintf(w, "Hello Docker!!") | |
}) | |
log.Println("start server") | |
server := &http.Server{Addr: ":8080"} | |
if err := server.ListenAndServe(); err != nil { | |
log.Println(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment