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