Remove templates and add vue template

This commit is contained in:
2022-01-17 22:05:43 +00:00
parent 663f247080
commit aa33c148cb
53 changed files with 452 additions and 2499 deletions

View File

@ -37,15 +37,19 @@ func (h *Handler) Serve() {
}
router.HTMLRender = templates
static, err := fs.Sub(web.Static, "static")
static, err := fs.Sub(web.Static, "dist")
if err != nil {
panic("couldn't open static files")
}
router.Use(enableCachingForStaticFiles())
router.StaticFS("/static", http.FS(static))
staticFS := http.FS(static)
router.Use(enableCachingForStaticFiles())
router.NoRoute(
func(c *gin.Context) {
c.FileFromFS(c.Request.URL.Path, staticFS)
},
)
router.GET("/", func(c *gin.Context) { c.HTML(http.StatusOK, "index.html", nil) })
router.GET("/login", h.login)
router.GET("/register", h.register)