better test endpoint ui layout (#36)

This commit is contained in:
Michael Quigley
2022-09-01 14:29:48 -04:00
parent d8f514efb7
commit 9e26229ff0
4 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ func StaticBuilder(handler http.Handler) http.Handler {
logrus.Debugf("directing '%v' to static handler", r.URL.Path)
staticPath := "build"
indexPath := "index.html"
indexPath := "index.gohtml"
// get the absolute path to prevent directory traversal
path, err := filepath.Abs(r.URL.Path)
@@ -35,7 +35,7 @@ func StaticBuilder(handler http.Handler) http.Handler {
_, err = FS.Open(path)
if os.IsNotExist(err) {
// file does not exist, serve index.html
// file does not exist, serve index.gohtml
index, err := FS.ReadFile(filepath.Join(staticPath, indexPath))
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)