From ce1ddd1d210996aa598fa7b8463513f753d69c23 Mon Sep 17 00:00:00 2001 From: Kneatrum Date: Wed, 21 Aug 2024 00:40:58 +0300 Subject: [PATCH] Setting up service names --- back-end/mqtt/subscriber.js | 6 ++---- front-end/src/components/charts/DoughnutChart.js | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/back-end/mqtt/subscriber.js b/back-end/mqtt/subscriber.js index e49679e..b39e867 100644 --- a/back-end/mqtt/subscriber.js +++ b/back-end/mqtt/subscriber.js @@ -1,9 +1,7 @@ const mqtt = require('mqtt'); -require('dotenv').config(); -const CONFIG = require('../../config.json'); -const brokerHost = CONFIG.mosquitto.host; -const brokerPort = CONFIG.mosquitto.port; +const brokerHost = 'mosquitto'; +const brokerPort = 1883; const { ch_temperature, diff --git a/front-end/src/components/charts/DoughnutChart.js b/front-end/src/components/charts/DoughnutChart.js index c2262b9..2780a18 100644 --- a/front-end/src/components/charts/DoughnutChart.js +++ b/front-end/src/components/charts/DoughnutChart.js @@ -2,10 +2,9 @@ import { Doughnut } from 'react-chartjs-2'; import axios from 'axios'; import { Chart as ChartJS, ArcElement, Legend, Tooltip, plugins } from "chart.js"; import { useEffect, useState } from 'react'; -const CONFIG = require('../../../../config.json'); -const backEndHost = CONFIG["back-end"].host; -const backEndPort = CONFIG["back-end"].port; +const backEndHost = 'back-end'; +const backEndPort = 3000; ChartJS.register( ArcElement,