2023-01-12 03:34:36 +01:00
|
|
|
import { DynamicModule, Global, Module, ModuleMetadata, Provider } from '@nestjs/common';
|
2023-01-18 15:40:15 +01:00
|
|
|
import { APIKeyService } from './api-key';
|
2023-01-12 03:34:36 +01:00
|
|
|
import { UserService } from './user';
|
|
|
|
|
|
|
|
const providers: Provider[] = [
|
|
|
|
//
|
2023-01-18 15:40:15 +01:00
|
|
|
APIKeyService,
|
2023-01-12 03:34:36 +01:00
|
|
|
UserService,
|
|
|
|
];
|
|
|
|
|
|
|
|
@Global()
|
|
|
|
@Module({})
|
|
|
|
export class DomainModule {
|
|
|
|
static register(options: Pick<ModuleMetadata, 'imports'>): DynamicModule {
|
|
|
|
return {
|
|
|
|
module: DomainModule,
|
|
|
|
imports: options.imports,
|
|
|
|
providers: [...providers],
|
|
|
|
exports: [...providers],
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|