|
|
|
import { Module } from '@nestjs/common'
|
|
|
|
import { ConfigModule } from '@nestjs/config'
|
|
|
|
import * as Joi from 'joi'
|
|
|
|
|
|
|
|
import { AppController } from './app.controller'
|
|
|
|
import { AuthModule } from './auth/auth.module'
|
|
|
|
import { ChatModule } from './chat/chat.module'
|
|
|
|
import { DbModule } from './db/db.module'
|
|
|
|
import { PongModule } from './pong/pong.module'
|
|
|
|
import { UsersModule } from './users/users.module'
|
|
|
|
|
|
|
|
@Module({
|
|
|
|
imports: [
|
|
|
|
ConfigModule.forRoot({
|
|
|
|
validationSchema: Joi.object({
|
|
|
|
POSTGRES_HOST: Joi.string().required(),
|
|
|
|
POSTGRES_PORT: Joi.number().required(),
|
|
|
|
POSTGRES_USER: Joi.string().required(),
|
|
|
|
POSTGRES_PASSWORD: Joi.string().required(),
|
|
|
|
POSTGRES_DB: Joi.string().required(),
|
|
|
|
BACK_PORT: Joi.number(),
|
|
|
|
JWT_SECRET: Joi.string().required(),
|
|
|
|
JWT_EXPIRATION_TIME: Joi.string().required()
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
AuthModule,
|
|
|
|
ChatModule,
|
|
|
|
DbModule,
|
|
|
|
PongModule,
|
|
|
|
UsersModule
|
|
|
|
],
|
|
|
|
controllers: [AppController]
|
|
|
|
})
|
|
|
|
export class AppModule { }
|