framework/pkg/utils/htmx.go

11 lines
253 B
Go

package utils
import "github.com/labstack/echo/v4"
func IsHTMX(c echo.Context) bool {
return c.Request().Header.Get("HX-Request") == "true"
}
func HTMXRedirect(c echo.Context, location string) {
c.Response().Header().Set("HX-Redirect", location)
}