diff --git a/VNode/services/buzzer/buzzer-watcher.js b/VNode/services/buzzer/buzzer-watcher.js index a59eacaa..498d10e5 100644 --- a/VNode/services/buzzer/buzzer-watcher.js +++ b/VNode/services/buzzer/buzzer-watcher.js @@ -1,9 +1,10 @@ +const path = require('path'); const ping = require('ping'); const mqtt = require('mqtt'); const fs = require('fs'); // Lecture du fichier de configuration -const config = JSON.parse(fs.readFileSync('\services\\config\\config_network.json', 'utf8')); +const config = JSON.parse(fs.readFileSync(path.join('services','config','config_network.json'), 'utf8')); // Extraction des informations de config const { hosts: { buzzers: { IP: buzzerIPs, MQTTconfig: { mqttHost, mqttTopic } } } } = config; diff --git a/VNode/services/game/quizz-collector.js b/VNode/services/game/quizz-collector.js index 5ca21f09..1edbea59 100644 --- a/VNode/services/game/quizz-collector.js +++ b/VNode/services/game/quizz-collector.js @@ -1,8 +1,9 @@ const fs = require('fs'); const mqtt = require('mqtt'); +const path = require('path'); // Lecture du fichier de configuration -const config = JSON.parse(fs.readFileSync('\services\\config\\config_game.json', 'utf8')); +const config = JSON.parse(fs.readFileSync(path.join('services','config','config_game.json'), 'utf8')); // Extraction des informations de config const { services: { mqttHost, quizzcollector: { MQTTconfig: { mqttQuizzCollectorListTopic, mqttQuizzCollectorCmdTopic } } } } = config; diff --git a/VNode/services/game/score-manager.js b/VNode/services/game/score-manager.js index bb3f9391..af9564a6 100644 --- a/VNode/services/game/score-manager.js +++ b/VNode/services/game/score-manager.js @@ -132,7 +132,7 @@ function updateTeamTotalScore(teamColor, points) { // Lecture du fichier de configuration -const config = JSON.parse(fs.readFileSync('\services\\config\\config_game.json', 'utf8')); +const config = JSON.parse(fs.readFileSync(path.join('services','config','config_game.json'), 'utf8')); // Extraction des informations de config const { services: { mqttHost, score: { MQTTconfig: { mqttScoreTopic, mqttScoreChangeTopic } } } } = config;