mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-26 00:21:36 +01:00
fixup! fixup! WIP: Using socket.io for websocket handling
This commit is contained in:
parent
f07e3f323f
commit
3b560cb98f
|
@ -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 = {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user