Skip to content

Defaults

go
// register api defaults to facade
import (
	...
	combyApi "github.com/gradientzero/comby/api"
	combyApiMiddleware "github.com/gradientzero/comby/api/middleware"
	combyAuth "github.com/gradientzero/comby/domain/auth"
)

router := chi.NewRouter()
humaApi := humachi.New(router, huma.DefaultConfig("My API", "1.0.0"))
humaApi.UseMiddleware(combyApiMiddleware.AuthSenderCtx(combyAuth.ApiReadmodel))
humaApi.UseMiddleware(combyApiMiddleware.AuthTargetCtx())
combyApi.RegisterDefaults(fc, humaApi)

and register comby default domains to your application:

go
// register comby defaults to facade
import "github.com/gradientzero/comby/domain"
...
domain.RegisterDefaults(ctx, fc)