fix: properly redirect /static/* to /assets/*
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-04-27 17:43:34 +02:00
parent d99d86a2be
commit bde8cfc88e
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -20,11 +20,15 @@ func (a *App) SetupRoutes() {
// keep /static/* as a compatibility fallback for /assets.
e.GET(
"/static/*",
nil,
func(c echo.Context) error {
return c.Redirect(http.StatusSeeOther, c.Request().URL.Path)
},
middleware.Rewrite(
map[string]string{"/static/*": "/assets/$1"},
),
)
// alternative:
// e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", assets)))
e.GET("/assets/*", echo.WrapHandler(http.StripPrefix("/assets/", assets)))
e.GET("/", handlers.Index())
e.GET("/signin", handlers.Signin())