fixing configuration bug
This commit is contained in:
parent
4c8a12e704
commit
88f3f0a036
@ -5,10 +5,11 @@ import { WebhookController } from './controllers/webhook.controller';
|
||||
import { WebhookService } from './services/webhook.service';
|
||||
import { RabbitMQService } from './services/rabbit.service';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import rabbitmqConfig from './config/rabbitmq.config';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({ isGlobal: true,load: [() => require('./config/rabbitmq.config').default()] }),
|
||||
ConfigModule.forRoot({ isGlobal: true,load: [rabbitmqConfig] }),
|
||||
],
|
||||
controllers: [AppController, WebhookController],
|
||||
providers: [AppService, WebhookService, RabbitMQService],
|
||||
|
||||
@ -18,7 +18,7 @@ export class RabbitMQService implements OnModuleInit {
|
||||
const pass = this.configService.get<string>('rabbitmq.pass');
|
||||
const host = this.configService.get<string>('rabbitmq.host');
|
||||
const port = this.configService.get<string>('rabbitmq.port');
|
||||
|
||||
|
||||
this.connection = await connect(`amqp://${user}:${pass}@${host}:${port}`);
|
||||
this.channel = await this.connection.createChannel();
|
||||
console.log('Connected to RabbitMQ');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user