add env port

This commit is contained in:
yogiedigital
2025-09-20 03:34:11 +07:00
parent 803e510da0
commit b23788254a
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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, {