+ to the git
This commit is contained in:
15
handler/util.go
Normal file
15
handler/util.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/a-h/templ"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/session"
|
||||
)
|
||||
|
||||
var store = session.New()
|
||||
|
||||
func render(c *fiber.Ctx, component templ.Component) error {
|
||||
// or templ wil bork...
|
||||
c.Set("Content-type", "text/html")
|
||||
return component.Render(c.Context(), c.Response().BodyWriter())
|
||||
}
|
||||
Reference in New Issue
Block a user