mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
refreact
server url calculated in constants
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
// TODO: should be defined dynamically?
|
|
||||||
export const serverURL = 'http://localhost';
|
|
||||||
export const NODE_PORT = 4001;
|
export const NODE_PORT = 4001;
|
||||||
|
|
||||||
|
const calculateServer = () => {
|
||||||
|
return window.location.origin.replace(window.location.port, `${NODE_PORT}/`);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const serverURL = calculateServer();
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { NODE_PORT } from './apiConstants';
|
import { serverURL } from './apiConstants';
|
||||||
|
|
||||||
// get origin from URL
|
|
||||||
const serverURL = window.location.origin.replace(
|
|
||||||
window.location.port,
|
|
||||||
`${NODE_PORT}/`
|
|
||||||
);
|
|
||||||
|
|
||||||
export const eventNamespace = 'event';
|
export const eventNamespace = 'event';
|
||||||
export const eventURL = serverURL + eventNamespace;
|
export const eventURL = serverURL + eventNamespace;
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { NODE_PORT } from '../api/apiConstants';
|
import { serverURL } from '../api/apiConstants';
|
||||||
|
|
||||||
// get origin from URL
|
|
||||||
const serverURL = window.location.origin.replace(
|
|
||||||
window.location.port,
|
|
||||||
`${NODE_PORT}/`
|
|
||||||
);
|
|
||||||
|
|
||||||
export const playbackNamespace = 'playback';
|
export const playbackNamespace = 'playback';
|
||||||
const playbackURL = serverURL + playbackNamespace;
|
const playbackURL = serverURL + playbackNamespace;
|
||||||
|
|||||||
Reference in New Issue
Block a user