feat: add backend-mock app
This commit is contained in:
39
apps/backend-mock/src/app.module.ts
Normal file
39
apps/backend-mock/src/app.module.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import configuration from '@/config/index';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import Joi from 'joi';
|
||||
|
||||
import { AuthModule } from './modules/auth/auth.module';
|
||||
import { DatabaseModule } from './modules/database/database.module';
|
||||
import { HealthModule } from './modules/health/health.module';
|
||||
import { UsersModule } from './modules/users/users.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forRoot({
|
||||
autoLoadEntities: true,
|
||||
database: 'data/db.sqlite',
|
||||
synchronize: true,
|
||||
type: 'sqlite',
|
||||
}),
|
||||
ConfigModule.forRoot({
|
||||
cache: true,
|
||||
isGlobal: true,
|
||||
load: [configuration],
|
||||
validationOptions: {
|
||||
abortEarly: true,
|
||||
allowUnknown: true,
|
||||
},
|
||||
validationSchema: Joi.object({
|
||||
NODE_ENV: Joi.string().valid('development', 'production', 'test'),
|
||||
port: Joi.number(),
|
||||
}),
|
||||
}),
|
||||
HealthModule,
|
||||
AuthModule,
|
||||
UsersModule,
|
||||
DatabaseModule,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
Reference in New Issue
Block a user