[web-src] Allow the dev server to run against a remote forked-daapd instance
This commit is contained in:
parent
4188a54e37
commit
341acca184
|
@ -0,0 +1,2 @@
|
|||
VUE_APP_JSON_API_SERVER='http://localhost:3689'
|
||||
VUE_APP_WEBSOCKET_SERVER='ws://localhost:3688'
|
|
@ -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 }
|
||||
)
|
||||
|
|
|
@ -24,13 +24,13 @@ module.exports = {
|
|||
// localhost:3689
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3689'
|
||||
target: process.env.VUE_APP_JSON_API_SERVER
|
||||
},
|
||||
'/artwork': {
|
||||
target: 'http://localhost:3689'
|
||||
target: process.env.VUE_APP_JSON_API_SERVER
|
||||
},
|
||||
'/stream.mp3': {
|
||||
target: 'http://localhost:3689'
|
||||
target: process.env.VUE_APP_JSON_API_SERVER
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue