server url calculated in constants
This commit is contained in:
cv
2021-05-04 22:15:41 +02:00
parent 56926d2226
commit eb18334fea
3 changed files with 8 additions and 16 deletions
+6 -2
View File
@@ -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();