htmgo/partials/base.go
2024-09-11 21:06:34 -05:00

16 lines
305 B
Go

package partials
import (
"github.com/gofiber/fiber/v2"
"mhtml/h"
)
func RegisterPartials(f *fiber.App) {
f.All("/mhtml/partials*", func(ctx *fiber.Ctx) error {
partial := GetPartialFromContext(ctx)
if partial == nil {
return ctx.SendStatus(404)
}
return h.PartialView(ctx, partial)
})
}