trying to just redirect ws

This commit is contained in:
ari committed 2022-06-04 15:45:14 -04:00
1 parent e6e51be5a5
commit 079f353dbf
8 files changed
+114 -60

No files matched your search

+7 -7
View File
@@ -5,15 +5,15 @@ import { useAPIService } from './core';
import { useMockAPI } from "./mock";
const locationPrefixWeb = window.location.pathname.match(/(.+)\/web/i);
const baseURL = process.env.NODE_ENV === 'development' ?
"http://localhost:8000" :
(!locationPrefixWeb ? '' : locationPrefixWeb[1]);
export const remoteDetailsAPI = makeRemoteAPI(
baseURL + "/details"
const baseURL = new URL(
process.env.NODE_ENV === 'development' ?
"http://localhost:8000" :
(!locationPrefixWeb ? '' : locationPrefixWeb[1])
);
export const wsURL = baseURL + "socket"
console.log({ baseURL, wsURL })
export const remoteAutoAPI = makeRemoteAPI(
baseURL + "/automations"
baseURL + "automations"
);
export const useConnectedApiService = () => useAPIService(
makeAutomationAPI(remoteAutoAPI)