package main import ( "fmt" "net/http" "github.com/gorilla/mux" ) // setupHTTPServer defines a new http server func setupHTTPServer() http.Server { r := mux.NewRouter() r.HandleFunc("/", indexHandler) return http.Server{ Addr: fmt.Sprintf("0.0.0.0:%d", *port), Handler: r, } } // indexHandler handles the "/" endpoint func indexHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "This is the index Handler speaking! Prepare to HACK THE PLANET!") }