Open Jxckaroo opened 1 year ago
change this line https://github.com/go-saas/saas/blob/0b157bcf9a4e237767611149f972a4a9ff4628d9/examples/gorm/main.go#L136-L137 to
import(
...
shttp "github.com/go-saas/saas/http"
...
)
...
r.Use(sgin.MultiTenancy(tenantStore,
sgin.WithMultiTenancyOption(shttp.NewWebMultiTenancyOption("", "([-a-z0-9]+)\\.mysaasapp\\.com"))))
adjust your own tenant name regex format
see https://github.com/go-saas/saas/blob/main/http/domain_tenant_resolve_contrib.go
Hey 👋
Love the work!
Do you have an example of multi tenancy via domains with individual databases? For example:
Main domain: mysaasapp.com Tenant domain: tenantname.mysaasapp.com Tenant 2 domain tenanttwoname.mysaasapp.com
etc? From what I read, its supported, but unsure on implementation.