Created
January 1, 2024 16:55
-
-
Save mhrlife/4cb0ee8ade7f73e545d36124c580dcb4 to your computer and use it in GitHub Desktop.
Render templ component in Go-Echo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Render(c echo.Context, comp templ.Component) error { | |
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) | |
return comp.Render(c.Request().Context(), c.Response().Writer) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment