github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2013/oscon-dl/server-hello.go (about)

     1  // +build ignore,OMIT
     2  
     3  package main
     4  
     5  import (
     6  	"fmt"
     7  	"log"
     8  	"net/http"
     9  	"os"
    10  )
    11  
    12  func handler(w http.ResponseWriter, r *http.Request) {
    13  	fmt.Fprintf(os.Stdout, "%s details: %+v\n", r.URL.Path, r)
    14  	fmt.Fprintf(w, "Hello, world! at %s\n", r.URL.Path)
    15  }
    16  
    17  func main() {
    18  	log.Printf("Running...")
    19  	log.Fatal(http.ListenAndServe("127.0.0.1:8080", http.HandlerFunc(handler)))
    20  }