func init() { services.Init() gob.Register(services.MapUrlServiceCount{}) // for services.Refresh handler := web.BuildHandler(utilsFunc, false) http.Handle("/", handler) }
func main() { services.Init() handler := web.BuildHandler(utilsFunc, true) port := os.Getenv("PORT") if len(port) == 0 { port = "8080" } fmt.Printf("Listening on %s...\n", port) log.Fatal(http.ListenAndServe(":"+port, handler)) }