diff --git a/main.go b/main.go index 0f87a45..77d4251 100644 --- a/main.go +++ b/main.go @@ -244,7 +244,7 @@ func main() { os.Exit(1) } - web = &Webserver(9563) + web = Webserver(9563) <-dj.keepAlive } diff --git a/web.go b/web.go index be4ce6e..1370628 100644 --- a/web.go +++ b/web.go @@ -27,15 +27,14 @@ type Page struct { var external_ip = "" -func Webserver(port int) WebServer { - var webserver = WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)} +func Webserver(port int) *WebServer { http.HandleFunc("/", webserver.homepage) http.HandleFunc("/add", webserver.add) http.HandleFunc("/volume", webserver.volume) http.HandleFunc("/skip", webserver.skip) http.ListenAndServe(":"+strconv.Itoa(port), nil) rand.Seed(time.Now().UnixNano()) - return webserver + return &WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)} } func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {