admin-vben/apps/backend-mock/src/app.module.ts

35 lines
936 B
TypeScript
Raw Normal View History

2024-06-30 06:09:44 +00:00
import configuration from '@/config/index';
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import Joi from 'joi';
import { AuthModule } from './modules/auth/auth.module';
import { HealthModule } from './modules/health/health.module';
import { MenuModule } from './modules/menu/menu.module';
2024-06-30 14:28:35 +00:00
import { MockModule } from './modules/mock/mock.module';
2024-06-30 06:09:44 +00:00
import { UsersModule } from './modules/users/users.module';
@Module({
imports: [
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,
MenuModule,
2024-06-30 14:28:35 +00:00
MockModule,
2024-06-30 06:09:44 +00:00
],
})
export class AppModule {}