mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 18:01:39 +00:00
(no commit message provided)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
// Render renders a templ.Component
|
||||
func Render(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Writer.WriteHeader(http.StatusOK)
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
return cmp.Render(c.Request().Context(), c.Response())
|
||||
}
|
||||
Reference in New Issue
Block a user