diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 863cec455..566151a43 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -10,6 +10,16 @@ export const makeBitcoinAPI = ({ } else { network = ''; } + + if(hostname?.includes("localhost")){ + const api = axios.create({ + baseURL: `http://${hostname}${network}/api/`, + }); + return { + api, + }; + } + const api = axios.create({ baseURL: `https://${hostname}${network}/api/`, }); @@ -19,6 +29,16 @@ export const makeBitcoinAPI = ({ }; export const makeBisqAPI = (hostname?: string): { api: AxiosInstance } => { + + if(hostname?.includes("localhost")){ + const api = axios.create({ + baseURL: `http://${hostname}/bisq/api/`, + }); + return { + api, + }; + } + const api = axios.create({ baseURL: `https://${hostname}/bisq/api/`, }); @@ -28,6 +48,16 @@ export const makeBisqAPI = (hostname?: string): { api: AxiosInstance } => { }; export const makeLiquidAPI = (hostname?: string): { api: AxiosInstance } => { + + if(hostname?.includes("localhost")){ + const api = axios.create({ + baseURL: `http://${hostname}/liquid/api/`, + }); + return { + api, + }; + } + const api = axios.create({ baseURL: `https://${hostname}/liquid/api/`, });