Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-30 15:52:10 +01:00
parent 15ce071ef6
commit bc3193009f

12
web.go
View file

@ -49,8 +49,16 @@ func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
if uname == nil {
fmt.Fprintf(w, "Invalid Token")
} else {
t, _ := template.ParseFiles("index.html")
t.Execute(w, &Page{"http://" + getIP() + ":" + strconv.Itoa(web.port) + "/", r.URL.Path[1:]})
t, err := template.ParseFiles("index.html")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
err = t.Execute(w, &Page{"http://" + getIP() + ":" + strconv.Itoa(web.port) + "/", r.URL.Path[1:]})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
}