Fixing build issues
This commit is contained in:
parent
425885ae55
commit
6b8aa41691
|
@ -6,7 +6,7 @@
|
|||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function api(type) {
|
||||
return "{{.Site}}" + type + "?token={{.Token}}";
|
||||
return "http://{{.Site}}/" + type + "?token={{.Token}}";
|
||||
}
|
||||
|
||||
function addURL() {
|
||||
|
|
4
web.go
4
web.go
|
@ -31,6 +31,7 @@ type Page struct {
|
|||
var external_ip = ""
|
||||
|
||||
func NewWebServer(port int) *WebServer {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
return &WebServer{
|
||||
port: port,
|
||||
client_token: make(map[*gumble.User]string),
|
||||
|
@ -44,7 +45,6 @@ func (web *WebServer) makeWeb() {
|
|||
http.HandleFunc("/volume", web.volume)
|
||||
http.HandleFunc("/skip", web.skip)
|
||||
http.ListenAndServe(":"+strconv.Itoa(web.port), nil)
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -59,7 +59,7 @@ func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
err = t.Execute(w, Page{"http://" + getIP() + ":" + strconv.Itoa(web.port) + "/", r.URL.Path[1:], uname.Name})
|
||||
err = t.Execute(w, Page{getIP() + ":" + strconv.Itoa(web.port), r.URL.Path[1:], uname.Name})
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
|
Reference in a new issue