diff --git a/src/services/signalr/index.ts b/src/services/signalr/index.ts index 91d7082..449cd65 100644 --- a/src/services/signalr/index.ts +++ b/src/services/signalr/index.ts @@ -12,14 +12,19 @@ type ConnectionsDict = { [route: string]: HubConnection; }; +//var baseUrl = `http://192.168.1.70:5000` +var baseUrl = process.env.NODE_ENV === 'development' + ?'http://192.168.1.70:5000' + :'' + const Connections: ConnectionsDict = { 'hubs/telemetry': new HubConnectionBuilder() - .withUrl(`http://192.168.1.70:5000/hubs/telemetry`, ConnectionOptions)// + .withUrl(`${baseUrl}/hubs/telemetry`, ConnectionOptions)// .withAutomaticReconnect() .build(), 'hubs/reports': new HubConnectionBuilder() - .withUrl(`http://192.168.1.70:5000/hubs/reports`, ConnectionOptions) + .withUrl(`${baseUrl}/hubs/reports`, ConnectionOptions) .withAutomaticReconnect() .build() }