1.2.6 • Published 4 years ago
@digitalmedarbeider/multi-tenant v1.2.6
Multi-Tenant Module
========================================
This library is an angular module providing multi-tenant support
Quick start
Install this package
npm install @digitalmedarbeider/multi-tenant
Prepare the configuration
import { DiMeMultiTenantConfig, MultiTenantModule, MultitenantInterceptor } from '@digitalmedarbeider/multi-tenant';
const multitenantConfig:DiMeMultiTenantConfig={
key:"tenantId",
tenantResolveURL:"",
interceptDomains:[environment.api_url]
}
Prepare the interceptors:
const interceptors = [
{provide: HTTP_INTERCEPTORS, useClass:MultitenantInterceptor, multi:true}
]
Add the module to the imports, supply the config to the module
import:[
...
MultiTenantModule.forRoot(multitenantConfig)
...
]
Add interceptors to the providers list of the module
providers: [
....
interceptors
.....
]
To get the tenant selector component you can add
<tenant-selector><tenant-selector>