From 07218169a66cb53e255cdf07429434cc3c9331e2 Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Mon, 18 Jan 2021 20:18:03 +0100 Subject: [PATCH] static index.html files are now atuomatic used for the directoryroot. --- funcs/funcs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/funcs/funcs.go b/funcs/funcs.go index 68046fb..763e1ab 100644 --- a/funcs/funcs.go +++ b/funcs/funcs.go @@ -65,7 +65,11 @@ func StaticFS(r gin.IRouter, files fs.FS) { sub, _ := fs.Sub(files, fn.Name()) StaticFS(r.Group("/"+fn.Name()), sub) } else { - r.GET("/"+fn.Name(), makeHandler(files, fn.Name())) + h := makeHandler(files, fn.Name()) + if fn.Name() == "index.html" { + r.GET("/", h) + } + r.GET("/"+fn.Name(), h) } } }