[web-src] Allow the dev server to run against a remote forked-daapd instance

This commit is contained in:
chme
2020-05-02 08:43:10 +02:00
parent 4188a54e37
commit 341acca184
3 changed files with 12 additions and 4 deletions

View File

@@ -111,8 +111,14 @@ export default {
protocol = 'wss://'
}
var wsUrl = protocol + window.location.hostname + ':' + vm.$store.state.config.websocket_port
if (process.env.NODE_ENV === 'development' && process.env.VUE_APP_WEBSOCKET_SERVER) {
// If we are running in the development server, use the websocket url configured in .env.development
wsUrl = process.env.VUE_APP_WEBSOCKET_SERVER
}
var socket = new ReconnectingWebSocket(
protocol + window.location.hostname + ':' + vm.$store.state.config.websocket_port,
wsUrl,
'notify',
{ reconnectInterval: 3000 }
)