Files
cedetec_api_nest/src/app.module.ts
T

36 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-02-09 16:10:08 -06:00
import { Module } from '@nestjs/common';
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';
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({
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],
providers: [AppService],
2023-02-09 16:10:08 -06:00
})
export class AppModule {
static port: number
constructor(private readonly configService: ConfigService){
AppModule.port = this.configService.get('PORT')
}
}