merge into lino sam
This commit is contained in:
+30
-3
@@ -1,12 +1,39 @@
|
||||
import { ProfesorModule } from './Profesor/profesor.module';
|
||||
import { ProfesorController } from './Profesor/profesor.controller';
|
||||
import { ProfesorService } from './Profesor/profesor.service';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { UsersModule } from './users/users.module';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
@Module({
|
||||
imports: [AuthModule, UsersModule],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
imports: [
|
||||
AuthModule,
|
||||
UsersModule,
|
||||
ConfigModule.forRoot({
|
||||
envFilePath: '.env',
|
||||
isGlobal: true,
|
||||
}),
|
||||
TypeOrmModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
useFactory: async (configservice: ConfigService) => ({
|
||||
type: 'mariadb',
|
||||
host: configservice.get('DB_HOST'),
|
||||
port: configservice.get('DB_PORT'),
|
||||
username: configservice.get('DB_USER'),
|
||||
password: configservice.get('DB_PASSWORD'),
|
||||
database: configservice.get('DB_DATABASE'),
|
||||
entities: [],
|
||||
synchronize: configservice.get('DB_SYNCRONIZE'),
|
||||
}),
|
||||
}),
|
||||
ProfesorModule,
|
||||
],
|
||||
controllers: [ProfesorController, AppController],
|
||||
providers: [ProfesorService, AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user