Remove templates and add vue template
This commit is contained in:
14
http/http.go
14
http/http.go
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user