feat: add login and registration pages

This commit is contained in:
Prad Nukala
2024-10-01 14:42:11 -04:00
parent d486becbc6
commit e807691c64
24 changed files with 385 additions and 101 deletions
+25
View File
@@ -0,0 +1,25 @@
package pages
import (
"bytes"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
)
func echoResponse(c echo.Context, cmp templ.Component) error {
// Create a buffer to store the rendered HTML
buf := &bytes.Buffer{}
// Render the component to the buffer
err := cmp.Render(c.Request().Context(), buf)
if err != nil {
return err
}
// Set the content type
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
// Write the buffered content to the response
_, err = c.Response().Write(buf.Bytes())
return err
}