aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/main.go b/main.go
index 0edf6e9..1de6b6c 100644
--- a/main.go
+++ b/main.go
@@ -317,20 +317,7 @@ func LoadUsersFromEnviron() UsersMap {
func HandleIndex(f fs.FS) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-
- pth := filepath.Clean(r.URL.Path)
- fh, err := f.Open(pth)
- if err != nil {
- fh, err = f.Open("index.html")
- if err != nil {
- logger.Println(err)
- sendPlain(Response{w, http.StatusInternalServerError,
- "Internal server error", nil}, nil)
- return
- }
- }
-
- _, _ = io.Copy(w, fh)
+ logIfErr(renderHX(f, isHTMX(r), w, nil, "index.html"))
})
}