Move init of StaticFS and rename some vars
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"git.javil.eu/jacob1123/budgeteer"
|
||||
"git.javil.eu/jacob1123/budgeteer/bcrypt"
|
||||
"git.javil.eu/jacob1123/budgeteer/postgres"
|
||||
"git.javil.eu/jacob1123/budgeteer/web"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -36,12 +35,6 @@ func (h *Handler) Serve() {
|
||||
|
||||
// LoadRoutes initializes all the routes
|
||||
func (h *Handler) LoadRoutes(router *gin.Engine) {
|
||||
static, err := fs.Sub(web.Static, "dist")
|
||||
if err != nil {
|
||||
panic("couldn't open static files")
|
||||
}
|
||||
h.StaticFS = http.FS(static)
|
||||
|
||||
router.Use(enableCachingForStaticFiles())
|
||||
router.NoRoute(h.ServeStatic)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user