mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 05:16:47 +01:00
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
|
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
||
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||
|
import { databaseConfig } from './config/database.config';
|
||
|
import { UserModule } from './api-v1/user/user.module';
|
||
|
import { AssetModule } from './api-v1/asset/asset.module';
|
||
|
import { AuthModule } from './api-v1/auth/auth.module';
|
||
|
import { ImmichJwtModule } from './modules/immich-jwt/immich-jwt.module';
|
||
|
import { JwtModule } from '@nestjs/jwt';
|
||
|
import { DeviceInfoModule } from './api-v1/device-info/device-info.module';
|
||
|
import { AppLoggerMiddleware } from './middlewares/app-logger.middleware';
|
||
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||
|
import { immichAppConfig } from './config/app.config';
|
||
|
import { BullModule } from '@nestjs/bull';
|
||
|
import { ImageOptimizeModule } from './modules/image-optimize/image-optimize.module';
|
||
|
import { ServerInfoModule } from './api-v1/server-info/server-info.module';
|
||
|
|
||
|
@Module({
|
||
|
imports: [
|
||
|
ConfigModule.forRoot(immichAppConfig),
|
||
|
TypeOrmModule.forRoot(databaseConfig),
|
||
|
UserModule,
|
||
|
AssetModule,
|
||
|
AuthModule,
|
||
|
ImmichJwtModule,
|
||
|
DeviceInfoModule,
|
||
|
BullModule.forRootAsync({
|
||
|
imports: [ConfigModule],
|
||
|
useFactory: async (configService: ConfigService) => ({
|
||
|
redis: {
|
||
|
host: configService.get('REDIS_HOST'),
|
||
|
port: configService.get('REDIS_PORT'),
|
||
|
password: configService.get('REDIS_PASSWORD'),
|
||
|
},
|
||
|
}),
|
||
|
inject: [ConfigService],
|
||
|
}),
|
||
|
|
||
|
ImageOptimizeModule,
|
||
|
|
||
|
ServerInfoModule,
|
||
|
],
|
||
|
controllers: [],
|
||
|
providers: [],
|
||
|
})
|
||
|
export class AppModule implements NestModule {
|
||
|
configure(consumer: MiddlewareConsumer): void {
|
||
|
// consumer.apply(AppLoggerMiddleware).forRoutes('*');
|
||
|
}
|
||
|
}
|