Skip to content

Instantly share code, notes, and snippets.

@mhrlife
Created January 1, 2024 16:55
Show Gist options
  • Save mhrlife/4cb0ee8ade7f73e545d36124c580dcb4 to your computer and use it in GitHub Desktop.
Save mhrlife/4cb0ee8ade7f73e545d36124c580dcb4 to your computer and use it in GitHub Desktop.
Render templ component in Go-Echo
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