From aa2eacbf380ff7596a75472ce41cfc7e48bce5ac Mon Sep 17 00:00:00 2001 From: yogiedigital Date: Sat, 20 Sep 2025 01:43:40 +0700 Subject: [PATCH] add env port --- env.example | 3 ++- src/App.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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',