1 | import { DatabaseModule } from '@lxdhub/db';
|
2 | import { DynamicModule } from '@nestjs/common';
|
3 |
|
4 | import { LXDHubAPISettings } from '.';
|
5 | import { AppSettingsModule } from './app-settings';
|
6 | import { AppController } from './app.controller';
|
7 | import { ImageAvailabilityModule } from './image-availability';
|
8 | import { ImageModule } from './image/image.module';
|
9 | import { LogModule } from './log';
|
10 | import { LXDModule } from './lxd';
|
11 | import { RemoteModule } from './remote';
|
12 | import { SearchModule } from './search/search.module';
|
13 | import { ThirdPartyModule } from './third-party/third-party.module';
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export class AppModule {
|
19 | static forRoot(settings: LXDHubAPISettings): DynamicModule {
|
20 | return {
|
21 | module: AppModule,
|
22 | imports: [
|
23 | AppSettingsModule.forRoot(settings),
|
24 | DatabaseModule.forRoot({ ...settings.database, logLevel: settings.logLevel }),
|
25 | LogModule,
|
26 | ImageModule,
|
27 | ImageAvailabilityModule,
|
28 | RemoteModule,
|
29 | SearchModule,
|
30 | LXDModule,
|
31 | RemoteModule,
|
32 | ThirdPartyModule
|
33 | ],
|
34 | controllers: [AppController]
|
35 | };
|
36 | }
|
37 | }
|