mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-11-14 17:35:35 +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.
|
* 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 REFORIS_API_URL_PREFIX = `${REFORIS_URL_PREFIX}/api`;
|
||||||
|
|
||||||
export const ForisURLs = {
|
export const ForisURLs = {
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
|
|
||||||
/* eslint no-console: "off" */
|
/* eslint no-console: "off" */
|
||||||
|
|
||||||
|
import { REFORIS_URL_PREFIX } from "../utils/forisUrls";
|
||||||
|
|
||||||
const { io } = require("socket.io-client");
|
const { io } = require("socket.io-client");
|
||||||
|
|
||||||
export class WebSockets {
|
export class WebSockets {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.socket = io("/notifications", {
|
this.socket = io("/notifications", {
|
||||||
path: "/reforis/reforis-ws",
|
path: `${REFORIS_URL_PREFIX}/reforis-ws`,
|
||||||
});
|
});
|
||||||
this.connection = null;
|
this.connection = null;
|
||||||
this.socket.on("disconnect", (reason) => {
|
this.socket.on("disconnect", (reason) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user