From a0d180d53800662d52ca516ad30457279bccfd3a Mon Sep 17 00:00:00 2001 From: ori agranat Date: Wed, 13 Nov 2019 20:54:06 +0200 Subject: [PATCH] added connection url by development or production --- chameleon-client/src/main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chameleon-client/src/main.js b/chameleon-client/src/main.js index 5dc5ab704..4eac4e078 100644 --- a/chameleon-client/src/main.js +++ b/chameleon-client/src/main.js @@ -9,8 +9,13 @@ import axios from 'axios'; import VueAxios from "vue-axios"; Vue.config.productionTip = false; -Vue.prototype.$address = location.hostname + ":5800"; -// Vue.prototype.$address = location.host; + +if (process.env.NODE_ENV === "production"){ + Vue.prototype.$address = location.host; +} else if (process.env.NODE_ENV === "development"){ + Vue.prototype.$address = location.hostname + ":5800"; +} + Vue.use(VueNativeSock, 'ws://' + Vue.prototype.$address + '/websocket'); Vue.use(VueAxios, axios);