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