mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-16 11:14:38 -05:00
Use NODE_ENV
from Express and Socket.IO
This commit is contained in:
parent
efd7608ba2
commit
851ceef3d5
@ -35,7 +35,8 @@ export default {
|
|||||||
window.addEventListener('resize', this.onResize);
|
window.addEventListener('resize', this.onResize);
|
||||||
|
|
||||||
let wsHost;
|
let wsHost;
|
||||||
if (localStorage.dev === "dev") {
|
const env = process.env.NODE_ENV || 'development';
|
||||||
|
if (env === "development") {
|
||||||
wsHost = ":3001"
|
wsHost = ":3001"
|
||||||
} else {
|
} else {
|
||||||
wsHost = ""
|
wsHost = ""
|
||||||
@ -45,6 +46,10 @@ export default {
|
|||||||
transports: ['websocket']
|
transports: ['websocket']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!socket.connected) {
|
||||||
|
console.error("Failed to connect to the backend")
|
||||||
|
}
|
||||||
|
|
||||||
socket.on('info', (info) => {
|
socket.on('info', (info) => {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user