github.com/EngineerKamesh/gofullstack@v0.0.0-20180609171605-d41341d7d4ee/volume3/section2/3dgopher/server.go (about) 1 package main 2 3 import ( 4 "flag" 5 "log" 6 "net/http" 7 ) 8 9 var addr = flag.String("addr", "localhost:8080", "http service address") 10 11 func main() { 12 fs := http.FileServer(http.Dir("./static")) 13 flag.Parse() 14 log.SetFlags(0) 15 http.Handle("/", fs) 16 17 log.Fatal(http.ListenAndServe(*addr, nil)) 18 }