Skip to content

Instantly share code, notes, and snippets.

@ksato9700
Created January 17, 2019 11:39
Show Gist options
  • Save ksato9700/859329092470d8f4ccb4a6548bb7abae to your computer and use it in GitHub Desktop.
Save ksato9700/859329092470d8f4ccb4a6548bb7abae to your computer and use it in GitHub Desktop.
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