Tenant.SubdomainPlug (Tenant v2.0.0)

View Source

This is a basic plug that loads the current tenant assign from a given value set on subdomain.

To plug it on your router, you can use:

plug Tenant.SubdomainPlug,
  endpoint: MyApp.Endpoint,
  tenant_handler: &TenantHelper.tenant_handler/1

See Tenant.SubdomainPlugConfig to check all the allowed config flags.