Fixing build issues
This commit is contained in:
parent
5d18bd68d8
commit
2606fc4cb9
5
web.go
5
web.go
|
@ -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
|
||||
|
|
Reference in a new issue