diff --git a/package.json b/package.json index cc9ad56..166db9b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "postinstall": "electron-builder install-app-deps", "postuninstall": "electron-builder install-app-deps" }, - "main": "background.js", + "main": "src/background.js", "dependencies": { "@vue/devtools": "^6.0.0-beta.6", "autoprefixer": "^10", diff --git a/src/store.js b/src/store.js index 51cbfd8..418d82f 100644 --- a/src/store.js +++ b/src/store.js @@ -4,7 +4,9 @@ import { handleMsg, sendSub } from './utils/websocket' const token = window.localStorage.getItem('token') -const server = 'nuke.aplesports.com:5000' +const server = process.env.VUE_APP_NUKE_URI +const api_proto = process.env.VUE_APP_NUKE_API_PROTO +const ws_proto = process.env.VUE_APP_NUKE_WS_PROTO const state = reactive({ name: '', @@ -30,7 +32,7 @@ const methods = { authenticate: async (token) => { state.session = null window.localStorage.setItem('token', token) - return axios.post(`http://${server}/api/v1`, { + return axios.post(`${api_proto}://${server}/api/v1`, { token, }) .then((res) => { @@ -42,7 +44,7 @@ const methods = { }, connect: () => { if (state.session !== null) { - state.ws = new WebSocket(`ws://${server}/ws/${state.session}`) + state.ws = new WebSocket(`${ws_proto}://${server}/ws/${state.session}`) state.ws.onopen = () => { clearInterval(interval) sendSub(state.ws)