Advertisement
Guest User

Untitled

a guest
May 11th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import { Module } from '@nestjs/common';
  2. import { AppController } from './app.controller';
  3. import { AuthModule } from './auth/auth.module';
  4. import { CoreModule } from './core/core.module';
  5. import { TypeOrmModule } from '@nestjs/typeorm';
  6. import { PostsModule } from './posts/posts.module';
  7. import { ForumActivityModule } from './Forum-Activity/forum-activity.module';
  8. import { ConfigModule } from './config/config.module';
  9. import { ConfigService } from './config/config.service';
  10.  
  11. @Module({
  12. imports: [AuthModule, CoreModule, PostsModule, ForumActivityModule,ConfigModule,
  13. TypeOrmModule.forRootAsync({
  14. imports: [ConfigModule],
  15. inject: [ConfigService],
  16. useFactory: async (configService: ConfigService) => ({
  17. type: configService.dbType as any,
  18. host: configService.dbHost,
  19. port: configService.dbPort,
  20. username: configService.dbUsername,
  21. password: configService.dbPassword,
  22. database: configService.dbName,
  23. entities: ['./src/data/entities/*.ts'],
  24.  
  25. }),
  26. }),
  27. ],
  28. controllers: [AppController],
  29. providers: [],
  30. })
  31. export class AppModule {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement