Move the prod and dev websocket URI to a config file.
This commit is contained in:
parent
3359c84fe4
commit
50b3efec4c
2 changed files with 15 additions and 7 deletions
|
|
@ -4,17 +4,14 @@ import store from './store';
|
|||
import io from 'socket.io-client';
|
||||
import clipboard from "vue-clipboard2";
|
||||
import VueSocketIOExt from 'vue-socket.io-extended';
|
||||
import {websocket_uri, dev_websocket_uri} from "./config";
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
// Get the URI for dev enfironments
|
||||
let websocket_uri = `/`;
|
||||
if (process.env.NODE_ENV === `development`) {
|
||||
websocket_uri = `http://${window.location.hostname}:8081`;
|
||||
};
|
||||
|
||||
Vue.use(clipboard);
|
||||
Vue.use(VueSocketIOExt, io(websocket_uri));
|
||||
Vue.use(VueSocketIOExt, io(
|
||||
process.env.NODE_ENV === `development` ? websocket_uri : dev_websocket_uri
|
||||
));
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue