Fixing build issues
This commit is contained in:
parent
15ce071ef6
commit
bc3193009f
12
web.go
12
web.go
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue