fix: Code for category
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"gis/api"
|
||||
"gis/internal/config"
|
||||
"gis/internal/domain"
|
||||
"gis/internal/messaging/rabbitmq"
|
||||
"gis/internal/parser"
|
||||
"gis/internal/platform/logger"
|
||||
@@ -87,6 +88,9 @@ func New(ctx context.Context) (*App, error) {
|
||||
// Handler builds the HTTP handler with all routes and readiness checks wired.
|
||||
func (a *App) Handler() stdhttp.Handler {
|
||||
validate := validator.New(validator.WithRequiredStructEnabled())
|
||||
validate.RegisterValidation("slug", func(fl validator.FieldLevel) bool {
|
||||
return domain.ValidSlug(fl.Field().String())
|
||||
})
|
||||
|
||||
health := transporthttp.NewHealthHandler(map[string]transporthttp.ReadinessCheck{
|
||||
"postgres": func(ctx context.Context) error { return a.pool.Ping(ctx) },
|
||||
|
||||
Reference in New Issue
Block a user