diff --git a/env.example b/env.example index 11beab1..3f62998 100644 --- a/env.example +++ b/env.example @@ -1,4 +1,5 @@ VITE_API_URL=https://api.example.com VITE_APP_NAME=MyReactApp VITE_MQTT_SERVER=mosquitto-apotek-2 -# VITE_MQTT_SERVER=117.102.231.130 \ No newline at end of file +# VITE_MQTT_SERVER=117.102.231.130 +VITE_MQTT_PORT=4001 \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 35dc954..bcf6327 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -22,7 +22,7 @@ function App() { const mqttOptions = { host: `${import.meta.env.VITE_MQTT_SERVER}`, // host: 'mosquitto-apotek-2', - port: 7001, + port: Number(`${import.meta.env.VITE_MQTT_PORT}`), // protocol: "mqtt", username: 'morekmorekmorek', password: 'morek888',