update/improve-uix #2
@@ -1,8 +1,14 @@
|
|||||||
// Import necessary modules
|
// Import necessary modules
|
||||||
const mqtt = require('mqtt');
|
const mqtt = require('mqtt');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
// Load configuration
|
||||||
|
const configPath = path.join(__dirname, '../config/configuration.json');
|
||||||
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||||
|
|
||||||
// MQTT broker configuration
|
// MQTT broker configuration
|
||||||
const brokerUrl = 'mqtt://nanomq'; // Broker URL (change if needed)
|
const brokerUrl = config.mqttHost;
|
||||||
const clientId = 'buzzer_manager';
|
const clientId = 'buzzer_manager';
|
||||||
const options = {
|
const options = {
|
||||||
clientId,
|
clientId,
|
||||||
|
|||||||
Reference in New Issue
Block a user