88 lines
2.9 KiB
TypeScript
88 lines
2.9 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { AppController } from './app.controller';
|
|
import { AppService } from './app.service';
|
|
import { ParkioModule } from './parkio/parkio.module';
|
|
import { IswordModule } from './isword/isword.module';
|
|
import { AuthModule } from './auth/auth.module';
|
|
import { UsersModule } from './users/users.module';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { DomainrproxyModule } from './domainrproxy/domainrproxy.module';
|
|
import configuration from './config/configuration';
|
|
import { CacheModule, CacheStoreFactory } from '@nestjs/cache-manager';
|
|
import { IrcbotModule } from './ircbot/ircbot.module';
|
|
import { DinosaurwetModule } from './dinosaurwet/dinosaurwet.module';
|
|
import { OgScraperModule } from './ogscraper/ogscraper.module';
|
|
import { PrometheusModule } from '@willsoto/nestjs-prometheus';
|
|
import { MinioModule } from './minio/minio.module';
|
|
import { KvModule } from './kv/kv.module';
|
|
import { BullModule } from '@nestjs/bull';
|
|
import { ScheduleModule } from '@nestjs/schedule';
|
|
import { RedisClientOptions } from 'redis';
|
|
import { redisStore } from 'cache-manager-redis-yet';
|
|
import { RedirectsModule } from './redirects/redirects.module';
|
|
import { FileModule } from './file/file.module';
|
|
import { FocoLiveModule } from './foco-live/foco-live.module';
|
|
import { PowModule } from './pow/pow.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
ScheduleModule.forRoot(),
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
load: [configuration],
|
|
}),
|
|
CacheModule.registerAsync<RedisClientOptions>({
|
|
isGlobal: true,
|
|
inject: [ConfigService],
|
|
imports: [ConfigModule],
|
|
useFactory: async (configService: ConfigService) => ({
|
|
store: redisStore,
|
|
socket: {
|
|
host: configService.get<string>('redis.host'),
|
|
port: configService.get<number>('redis.port'),
|
|
},
|
|
database: configService.get<number>('redis.db'),
|
|
password: configService.get<string>('redis.password'),
|
|
}),
|
|
}),
|
|
BullModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
inject: [ConfigService],
|
|
useFactory: async (configService: ConfigService) => {
|
|
const config = {
|
|
redis: {
|
|
password: configService.get<string>('redis.password'),
|
|
host: configService.get<string>('redis.host'),
|
|
port: configService.get<number>('redis.port'),
|
|
db: configService.get<number>('redis.db'),
|
|
},
|
|
};
|
|
return config;
|
|
},
|
|
}),
|
|
PrometheusModule.register({
|
|
defaultLabels: {
|
|
app: 'us.dev api',
|
|
},
|
|
}),
|
|
CacheModule.register({ isGlobal: true }),
|
|
ParkioModule,
|
|
IswordModule,
|
|
AuthModule,
|
|
UsersModule,
|
|
DomainrproxyModule,
|
|
IrcbotModule,
|
|
DinosaurwetModule,
|
|
OgScraperModule,
|
|
MinioModule,
|
|
KvModule,
|
|
RedirectsModule,
|
|
FileModule,
|
|
FocoLiveModule,
|
|
PowModule,
|
|
],
|
|
controllers: [AppController],
|
|
providers: [AppService],
|
|
})
|
|
export class AppModule { }
|