🐇 Referencing the pertinent docker rabbitmq host when using docker-compose

This commit is contained in:
2021-10-21 21:03:42 -07:00
parent d50785b007
commit 22170c53b3

View File

@@ -1,7 +1,7 @@
import { logger } from "../utils/logger.utils";
//RabbitMQ
const amqp = require("amqplib/callback_api");
const rabbitUrl = process.env.DOCKER_HOST ? `amqp://${process.env.DOCKER_HOST}` : `amqp://localhost`;
const rabbitUrl = process.env.DOCKER_RABBITMQ_HOST ? `amqp://${process.env.DOCKER_RABBITMQ_HOST}` : `amqp://localhost`;
export const sendToRabbitMQ = (queueName, data) => {
// connect to local rabbitmq instance