Add localhost support.
This commit is contained in:
parent
7dec92a1bf
commit
1c32b05abe
@ -10,6 +10,16 @@ export const makeBitcoinAPI = ({
|
|||||||
} else {
|
} else {
|
||||||
network = '';
|
network = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hostname?.includes("localhost")){
|
||||||
|
const api = axios.create({
|
||||||
|
baseURL: `http://${hostname}${network}/api/`,
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
api,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: `https://${hostname}${network}/api/`,
|
baseURL: `https://${hostname}${network}/api/`,
|
||||||
});
|
});
|
||||||
@ -19,6 +29,16 @@ export const makeBitcoinAPI = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const makeBisqAPI = (hostname?: string): { api: AxiosInstance } => {
|
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({
|
const api = axios.create({
|
||||||
baseURL: `https://${hostname}/bisq/api/`,
|
baseURL: `https://${hostname}/bisq/api/`,
|
||||||
});
|
});
|
||||||
@ -28,6 +48,16 @@ export const makeBisqAPI = (hostname?: string): { api: AxiosInstance } => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const makeLiquidAPI = (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({
|
const api = axios.create({
|
||||||
baseURL: `https://${hostname}/liquid/api/`,
|
baseURL: `https://${hostname}/liquid/api/`,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user