changed address to dynamic

main
alex 2023-08-10 19:31:31 +02:00
parent 24762bbdc1
commit de42076c1f
1 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,8 @@ import { v4 as uuidv4 } from "uuid";
/**
* constants
*/
const wssProtocol = window.location.protocol === "https:" ? "wss://" : "ws://";
export const Constants = {
COLORS: {
PRIMARY: "#e67e22",
@ -18,9 +20,11 @@ export const Constants = {
//API_ADDRESS: "http://localhost:8080/v1",
//STATIC_CONTENT_ADDRESS: "http://localhost:8080/",
//WS_ADDRESS: "ws://localhost:8080/ws",
API_ADDRESS: "http://" + window.location.hostname + "/api/v1",
STATIC_CONTENT_ADDRESS: "http://" + window.location.hostname + "/api/",
WS_ADDRESS: "ws://" + window.location.hostname + "/ws",
API_ADDRESS:
window.location.protocol + "//" + window.location.hostname + "/api/v1",
STATIC_CONTENT_ADDRESS:
window.location.protocol + "//" + window.location.hostname + "/api/",
WS_ADDRESS: `${wssProtocol}${window.location.hostname}/ws`,
ROUTE_PATHS: {
GROUP_TASKS: "/group-tasks",
GROUP_TASKS_VIEW: "/group-tasks/",