mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 16:03:52 +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;
|
||||
|
||||
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 { NODE_PORT } from './apiConstants';
|
||||
|
||||
// get origin from URL
|
||||
const serverURL = window.location.origin.replace(
|
||||
window.location.port,
|
||||
`${NODE_PORT}/`
|
||||
);
|
||||
import { serverURL } from './apiConstants';
|
||||
|
||||
export const eventNamespace = 'event';
|
||||
export const eventURL = serverURL + eventNamespace;
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import { NODE_PORT } from '../api/apiConstants';
|
||||
|
||||
// get origin from URL
|
||||
const serverURL = window.location.origin.replace(
|
||||
window.location.port,
|
||||
`${NODE_PORT}/`
|
||||
);
|
||||
import { serverURL } from '../api/apiConstants';
|
||||
|
||||
export const playbackNamespace = 'playback';
|
||||
const playbackURL = serverURL + playbackNamespace;
|
||||
|
||||
Reference in New Issue
Block a user