From fe563d05ae387f5f5231ca348410685c9ab9367d Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 29 Sep 2017 20:40:02 +0200 Subject: Connect to port directly in development mode --- src/api/socket.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/socket.js b/src/api/socket.js index 549ed6a9..283e02e7 100644 --- a/src/api/socket.js +++ b/src/api/socket.js @@ -6,7 +6,11 @@ let requestIdCounter = 0; const callbacks = {}; export function setupSocketConnection(onConnect) { - socket = io.connect(window.location.protocol + "//" + window.location.hostname + ":" + window.location.port); + let port = window.location.port; + if (process.env.NODE_ENV !== 'production') { + port = 8081 + } + socket = io.connect(window.location.protocol + "//" + window.location.hostname + ":" + port); socket.on("connect", onConnect); socket.on("response", onSocketResponse); } -- cgit v1.2.3