Skip to content

Commit

Permalink
updated apiclient
Browse files Browse the repository at this point in the history
  • Loading branch information
Precious-Macaulay authored Nov 10, 2024
1 parent d7d8e35 commit 74f6a42
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/services/apiClient.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios, { AxiosInstance, AxiosResponse, AxiosError } from 'axios';

// const BASE_URL = "https://5000-astriaai-imagine-t7a0u5m1trj.ws-eu116.gitpod.io/"
// Conditionally set BASE_URL based on VITE_PROXY_URL environment variable
const BASE_URL = import.meta.env.VITE_PROXY_URL || '';

const apiClient: AxiosInstance = axios.create({
// baseURL: BASE_URL,
baseURL: BASE_URL,
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Expand All @@ -13,7 +14,7 @@ const apiClient: AxiosInstance = axios.create({

// multipart form data api client2
const apiClient2: AxiosInstance = axios.create({
// baseURL: BASE_URL,
baseURL: BASE_URL,
headers: {
'Content-Type': 'multipart/form-data',
Accept: 'application/json',
Expand Down Expand Up @@ -65,4 +66,4 @@ const handleApiError = (error: AxiosError): void => {
}
};

export { apiClient, apiClient2 };
export { apiClient, apiClient2 };

0 comments on commit 74f6a42

Please sign in to comment.