Continue migration to echo

This commit is contained in:
2022-08-20 22:44:59 +00:00
parent 1a11555075
commit 9da4a6f03e
10 changed files with 76 additions and 99 deletions

View File

@ -13,6 +13,7 @@ import (
"git.javil.eu/jacob1123/budgeteer/postgres"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
// Handler handles incoming requests.
@ -36,7 +37,10 @@ func (h *Handler) Serve() {
// LoadRoutes initializes all the routes.
func (h *Handler) LoadRoutes(router *echo.Echo) {
router.Use(enableCachingForStaticFiles())
router.Use(h.ServeStatic)
router.Use(middleware.StaticWithConfig(middleware.StaticConfig{
Filesystem: h.StaticFS,
HTML5: true,
}))
api := router.Group("/api/v1")