2023-02-09 16:10:08 -06:00
|
|
|
import { Module } from '@nestjs/common';
|
2023-02-16 16:49:52 -06:00
|
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
|
|
|
import { ConfigModule, ConfigService } from '@nestjs/config'
|
2023-02-09 16:10:08 -06:00
|
|
|
import { AppController } from './app.controller';
|
|
|
|
|
import { AppService } from './app.service';
|
2023-02-16 16:49:52 -06:00
|
|
|
import { EventosModule } from './eventos/eventos.module';
|
|
|
|
|
import { ParticipanteController } from './participante/participante.controller';
|
|
|
|
|
import { ParticipanteModule } from './participante/participante.module';
|
|
|
|
|
import { EventoParticipanteModule } from './evento-participante/evento-participante/evento-participante.module';
|
2023-02-09 16:10:08 -06:00
|
|
|
|
|
|
|
|
@Module({
|
2023-02-16 16:49:52 -06:00
|
|
|
imports: [
|
|
|
|
|
ConfigModule.forRoot({isGlobal: true}),
|
|
|
|
|
TypeOrmModule.forRoot({
|
|
|
|
|
type: 'mariadb',
|
|
|
|
|
host: 'localhost',
|
|
|
|
|
port: 3306,
|
|
|
|
|
username:'root',
|
|
|
|
|
password: 'password',
|
|
|
|
|
database: 'cedetec_proyectos',
|
|
|
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
|
|
|
synchronize: true
|
|
|
|
|
}),
|
|
|
|
|
EventosModule,
|
|
|
|
|
ParticipanteModule,
|
|
|
|
|
EventoParticipanteModule],
|
|
|
|
|
controllers: [AppController, ParticipanteController],
|
2023-02-13 13:24:30 -06:00
|
|
|
providers: [AppService],
|
2023-02-09 16:10:08 -06:00
|
|
|
})
|
2023-02-16 16:49:52 -06:00
|
|
|
export class AppModule {
|
|
|
|
|
static port: number
|
|
|
|
|
constructor(private readonly configService: ConfigService){
|
|
|
|
|
AppModule.port = this.configService.get('PORT')
|
|
|
|
|
}
|
|
|
|
|
}
|