-
Notifications
You must be signed in to change notification settings - Fork 1
/
AppModule.ts
85 lines (81 loc) · 3.01 KB
/
AppModule.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import {Module} from '@nestjs/common';
import {UserModule} from "./models/user/UserModule";
import {MessageModule} from "./models/message/MessageModule";
import {SocketModule} from './models/socket/SocketModule';
import {RoomModule} from './models/room/RoomModule';
import {ConfigModule} from './models/config/ConfigModule';
import {TypeOrmModule} from "@nestjs/typeorm";
import {Room} from "./models/room/RoomEntity";
import {User} from "./models/user/UserEntity";
import {UserMigration} from "./migration/User.migration";
import {RoomMigration} from "./migration/Room.migration";
import {Message} from "./models/message/MessageEntity";
import {ConfigService} from "./services/ConfigService";
import {DatabaseModule} from "./models/database/DatabaseModule";
// import {ConfigService} from "./services/ConfigService";
// import {config} from "./development.env";
@Module({
imports:
[
ConfigModule,
UserModule,
MessageModule,
RoomModule,
DatabaseModule,
// TypeOrmModule.forRoot({
// type: 'postgres',
// name: config.postgres.name,
// host: config.postgres.host,
// port: config.postgres.port,
// database: config.postgres.database,
// username: config.postgres.username,
// password: config.postgres.password,
// entities: [
// User, Room
// ],
// migrations: [
// UserMigration, RoomMigration
// ],
// synchronize: true
// }),
// TypeOrmModule.forRoot({
// type: 'mongodb',
// name: config.mongodb.name,
// // replicaSet: "real-chat-replica",
// host: config.mongodb.host,
// port: config.mongodb.port,
// database: config.mongodb.database,
// entities: [Message],
// synchronize: true,
// }),
// TypeOrmModule.forRoot({
// type: 'postgres',
// name: 'postgres',
// host: 'localhost',
// port: 5432,
// database: 'postgres',
// username: 'postgres',
// password: 'postgres',
// entities: [
// User, Room
// ],
// migrations: [
// UserMigration, RoomMigration
// ],
// synchronize: true
// }),
// TypeOrmModule.forRoot({
// type: 'mongodb',
// name: 'nosql',
// // replicaSet: "real-chat-replica",
// host: 'localhost',
// port: 27017,
// database: 'test',
// entities: [Message],
// synchronize: true,
// }),
SocketModule,
],
})
export class ApplicationModule {
}