apps/api/src/app/app.module.ts
import { Module } from '@nestjs/common'
import { AppController } from './app.controller'
import { AppService } from './app.service'
import { ConfigModule, ConfigService } from '@nestjs/config'
import { typeOrmConfig } from '../config/typeorm.config'
import { TypeOrmModule } from '@nestjs/typeorm'
import { TerminusModule } from '@nestjs/terminus'
import { AuthModule } from '../auth/auth.module'
@Module({
imports: [
TerminusModule,
ConfigModule.forRoot({
isGlobal: true,
load: [typeOrmConfig]
}),
TypeOrmModule.forRootAsync({
inject: [ConfigService],
useFactory: async (configService: ConfigService) => {
return {
...configService.get('typeorm'),
/**
* This is temporary for development
*/
logging: 'all',
logger: 'advanced-console'
}
}
}),
AuthModule
],
controllers: [AppController],
providers: [AppService]
})
export class AppModule {}