engine: resources: Add a ui redirect

I always forget the /index.html part so make it easier!
This commit is contained in:
James Shubin
2025-05-15 02:52:57 -04:00
parent 43492a8cfa
commit 861ba50f9c

View File

@@ -297,6 +297,10 @@ func (obj *HTTPUIRes) ServeHTTP(w http.ResponseWriter, req *http.Request) {
} }
router.SetHTMLTemplate(templ) router.SetHTMLTemplate(templ)
router.GET(obj.routerPath("/"), func(c *gin.Context) {
c.Redirect(http.StatusMovedPermanently, obj.routerPath("/index.html"))
})
router.GET(obj.routerPath("/index.html"), func(c *gin.Context) { router.GET(obj.routerPath("/index.html"), func(c *gin.Context) {
h := gin.H{} h := gin.H{}
h["program"] = obj.init.Program h["program"] = obj.init.Program