Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-30 17:32:56 +01:00
parent 5d18bd68d8
commit 2606fc4cb9

5
web.go
View file

@ -7,6 +7,8 @@ import (
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
"net/http" "net/http"
"os"
"path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -49,7 +51,8 @@ func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) {
if uname == nil { if uname == nil {
fmt.Fprintf(w, "Invalid Token") fmt.Fprintf(w, "Invalid Token")
} else { } else {
t, err := template.ParseFiles("./index.html") cwd, _ := os.Getwd()
t, err := template.ParseFiles(filepath.Join(cwd, "./index.html"))
if err != nil { if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
return return