websocket development config

This commit is contained in:
Фролов 2021-07-26 16:54:48 +05:00
parent 98c26132d2
commit 90801ff31b

View File

@ -12,14 +12,19 @@ type ConnectionsDict = {
[route: string]: HubConnection; [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 = { const Connections: ConnectionsDict = {
'hubs/telemetry': new HubConnectionBuilder() 'hubs/telemetry': new HubConnectionBuilder()
.withUrl(`http://192.168.1.70:5000/hubs/telemetry`, ConnectionOptions)// .withUrl(`${baseUrl}/hubs/telemetry`, ConnectionOptions)//
.withAutomaticReconnect() .withAutomaticReconnect()
.build(), .build(),
'hubs/reports': new HubConnectionBuilder() 'hubs/reports': new HubConnectionBuilder()
.withUrl(`http://192.168.1.70:5000/hubs/reports`, ConnectionOptions) .withUrl(`${baseUrl}/hubs/reports`, ConnectionOptions)
.withAutomaticReconnect() .withAutomaticReconnect()
.build() .build()
} }