Просмотр исходного кода

Merge branch 'master' into comment

wuyi 2 лет назад
Родитель
Сommit
a5e9d9bbd6
1 измененных файлов с 17 добавлено и 1 удалено
  1. 17 1
      src/app.module.ts

+ 17 - 1
src/app.module.ts

@@ -25,6 +25,7 @@ import { LabelModule } from './label/label.module'
 import { MomentsModule } from './moments/moments.module'
 import { CommentModule } from './comment/comment.module'
 import { LikesModule } from './likes/likes.module'
+import { ChatPdfModule } from './chat-pdf/chat-pdf.module';
 @Module({
     imports: [
         DevtoolsModule.register({
@@ -69,6 +70,20 @@ import { LikesModule } from './likes/likes.module'
                 }
             })
         }),
+        TypeOrmModule.forRootAsync({
+            imports: [ConfigModule],
+            inject: [ConfigService],
+            useFactory: (config: ConfigService) => ({
+                name: 'db1',
+                type: 'postgres',
+                host: config.get<string>('PG_HOST'),
+                port: config.get<number>('PG_PORT'),
+                username: config.get<string>('PG_USERNAME'),
+                password: config.get<string>('PG_PASSWORD'),
+                database: config.get<string>('PG_DATABASE'),
+                synchronize: true
+            })
+        }),
         AliyunModule,
         SmsModule,
         UsersModule,
@@ -88,6 +103,7 @@ import { LikesModule } from './likes/likes.module'
         MomentsModule,
         CommentModule,
         LikesModule
+        ChatPdfModule
     ],
     controllers: [],
     providers: [
@@ -97,4 +113,4 @@ import { LikesModule } from './likes/likes.module'
         }
     ]
 })
-export class AppModule { }
+export class AppModule {}