33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { ThumbnailsModule } from './modules/thumbnails/thumbnails.module';
|
|
import { YouTubeModule } from './modules/youtube/youtube.module';
|
|
// import { AuthModule } from './modules/auth/auth.module'; // TODO: Enable when Google OAuth is configured
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
}),
|
|
TypeOrmModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
type: 'postgres',
|
|
host: configService.get('DB_HOST', 'localhost'),
|
|
port: configService.get('DB_PORT', 5432),
|
|
username: configService.get('DB_USERNAME', 'thumbpreview'),
|
|
password: configService.get('DB_PASSWORD', 'thumbpreview123'),
|
|
database: configService.get('DB_DATABASE', 'thumbpreview'),
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
synchronize: configService.get('NODE_ENV') !== 'production',
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
ThumbnailsModule,
|
|
YouTubeModule,
|
|
// AuthModule, // TODO: Enable when Google OAuth is configured
|
|
],
|
|
})
|
|
export class AppModule {}
|