Get devices ip in production, use .env for dev

This commit is contained in:
Sacha Weatherstone committed 2021-05-02 14:26:47 +10:00
1 parent 602187def5
commit d6be17a789
2 files changed
+5 -2

No files matched your search

+1
View File
@@ -0,0 +1 @@
SNOWPACK_PUBLIC_DEVICE_IP=
+4 -2
View File
@@ -76,9 +76,11 @@ const App = () => {
const client = new Client();
const connection = client.createHTTPConnection();
setConnection(connection);
// connection.connect(window.location.hostname, undefined, true);
connection.connect({
address: '192.168.1.103',
address:
import.meta.env.NODE_ENV === 'production'
? window.location.hostname
: import.meta.env.SNOWPACK_PUBLIC_DEVICE_IP,
receiveBatchRequests: false,
tls: false,
fetchInterval: 2000,