From 3b560cb98ff12b89bda0d2c6ade5189494e05886 Mon Sep 17 00:00:00 2001 From: Stepan Henek Date: Thu, 21 Jul 2022 16:39:07 +0200 Subject: [PATCH] fixup! fixup! WIP: Using socket.io for websocket handling --- src/utils/forisUrls.js | 2 +- src/webSockets/WebSockets.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/forisUrls.js b/src/utils/forisUrls.js index 341d1c1..3878c2c 100644 --- a/src/utils/forisUrls.js +++ b/src/utils/forisUrls.js @@ -5,7 +5,7 @@ * See /LICENSE for more information. */ -export const REFORIS_URL_PREFIX = "/reforis"; +export const REFORIS_URL_PREFIX = process.env.REFORIS_PREFIX || "/reforis"; export const REFORIS_API_URL_PREFIX = `${REFORIS_URL_PREFIX}/api`; export const ForisURLs = { diff --git a/src/webSockets/WebSockets.js b/src/webSockets/WebSockets.js index f819ab8..61df074 100644 --- a/src/webSockets/WebSockets.js +++ b/src/webSockets/WebSockets.js @@ -7,12 +7,14 @@ /* eslint no-console: "off" */ +import { REFORIS_URL_PREFIX } from "../utils/forisUrls"; + const { io } = require("socket.io-client"); export class WebSockets { constructor() { this.socket = io("/notifications", { - path: "/reforis/reforis-ws", + path: `${REFORIS_URL_PREFIX}/reforis-ws`, }); this.connection = null; this.socket.on("disconnect", (reason) => {