Skip to content

Commit

Permalink
support user defined HOST_URL
Browse files Browse the repository at this point in the history
Signed-off-by: ryjiang <[email protected]>
  • Loading branch information
shanghaikid committed Nov 22, 2023
1 parent 6caf54d commit 30ba02a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions client/src/http/Axios.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import axios from 'axios';
import { MILVUS_ADDRESS } from '@/consts';

// console.log(import.meta.env.NODE_ENV, 'api:', import.meta.env.VITE_BASE_URL);
// console.log('docker env', (window as any)._env_);
const isElectron =
(window as any)._env_ && (window as any)._env_.IS_ELECTRON === 'yes';
export const url =
import.meta.env.MODE === 'development' || isElectron
? (window as any)._env_ && (window as any)._env_.HOST_URL
: '';
((window as any)._env_ && (window as any)._env_.HOST_URL) || '';

const axiosInstance = axios.create({
baseURL: `${url}/api/v1`,
Expand Down

0 comments on commit 30ba02a

Please sign in to comment.