Fixing build issues
This commit is contained in:
parent
4678298ae9
commit
a246196786
17
web.go
17
web.go
|
@ -28,14 +28,17 @@ 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)}
|
return WebServer{port, make(map[*gumble.User]string), make(map[string]*gumble.User)}.construct()
|
||||||
http.HandleFunc("/", webserver.homepage)
|
}
|
||||||
http.HandleFunc("/add", webserver.add)
|
|
||||||
http.HandleFunc("/volume", webserver.volume)
|
func (web *WebServer) construct() *WebServer {
|
||||||
http.HandleFunc("/skip", webserver.skip)
|
http.HandleFunc("/", web.homepage)
|
||||||
http.ListenAndServe(":"+strconv.Itoa(port), nil)
|
http.HandleFunc("/add", web.add)
|
||||||
|
http.HandleFunc("/volume", web.volume)
|
||||||
|
http.HandleFunc("/skip", web.skip)
|
||||||
|
http.ListenAndServe(":"+strconv.Itoa(web.port), nil)
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
return webserver
|
return web
|
||||||
}
|
}
|
||||||
|
|
||||||
func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
|
func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
Reference in a new issue