Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-30 14:12:13 +01:00
parent 2be5407aa4
commit aee8e95ae1
2 changed files with 3 additions and 4 deletions

View file

@ -244,7 +244,7 @@ func main() {
os.Exit(1) os.Exit(1)
} }
web = &Webserver(9563) web = Webserver(9563)
<-dj.keepAlive <-dj.keepAlive
} }

5
web.go
View file

@ -27,15 +27,14 @@ type Page struct {
var external_ip = "" var external_ip = ""
func Webserver(port int) WebServer { func Webserver(port int) *WebServer {
var webserver = WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)}
http.HandleFunc("/", webserver.homepage) http.HandleFunc("/", webserver.homepage)
http.HandleFunc("/add", webserver.add) http.HandleFunc("/add", webserver.add)
http.HandleFunc("/volume", webserver.volume) http.HandleFunc("/volume", webserver.volume)
http.HandleFunc("/skip", webserver.skip) http.HandleFunc("/skip", webserver.skip)
http.ListenAndServe(":"+strconv.Itoa(port), nil) http.ListenAndServe(":"+strconv.Itoa(port), nil)
rand.Seed(time.Now().UnixNano()) 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) { func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {