fix: properly redirect /static/* to /assets/*
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d99d86a2be
commit
bde8cfc88e
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user