From b23788254a20a27254ba5732224bc0c040b6a78f Mon Sep 17 00:00:00 2001 From: yogiedigital Date: Sat, 20 Sep 2025 03:34:11 +0700 Subject: [PATCH] add env port --- env.example | 1 + src/App.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/env.example b/env.example index 0803a39..83e9924 100644 --- a/env.example +++ b/env.example @@ -2,5 +2,6 @@ VITE_API_URL=https://api.example.com VITE_APP_NAME=MyReactApp VITE_MQTT_SERVER=mosquitto-apotek-2 # VITE_MQTT_SERVER=117.102.231.130 +VITE_MQTT_URL=wss://mqtt.idetama.id:443/wss VITE_MQTT_PORT=4001 VITE_MQTT_PROTOCOL=mqtt \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index f0cf767..f5b8f1b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -44,7 +44,7 @@ function App() { try { // const connectUrl = `mqtt://${mqttOptions.host}:${mqttOptions.port}`; // const connectUrl = `${import.meta.env.VITE_MQTT_PROTOCOL}://${mqttOptions.host}:${mqttOptions.port}`; - const connectUrl = `wss://mqtt.idetama.id:443/wss`; + const connectUrl = `${import.meta.env.VITE_MQTT_URL}`; console.log('Attempting to connect to:', connectUrl); mqttClient = mqtt.connect(connectUrl, {