changing api to azure function app

This commit is contained in:
2024-11-25 20:17:27 -06:00
parent a40ca4ed8e
commit c66d75928c
2 changed files with 21 additions and 15 deletions

View File

@@ -1,22 +1,27 @@
import axios, { AxiosInstance, CreateAxiosDefaults } from 'axios';
export const useHttpClient = () => {
let config: CreateAxiosDefaults<any>;
let config: CreateAxiosDefaults<any> = {
baseURL: import.meta.env.VITE_API_URL,
headers: {
'Content-Type': 'application/json'
}
};
if (import.meta.env.DEV) {
config = {
baseURL: import.meta.env.VITE_API_URL,
headers: {
'Content-Type': 'application/json'
}
};
} else {
config = {
headers: {
'Content-Type': 'application/json'
}
};
}
// if (import.meta.env.DEV) {
// config = {
// baseURL: import.meta.env.VITE_API_URL,
// headers: {
// 'Content-Type': 'application/json'
// }
// };
// } else {
// config = {
// headers: {
// 'Content-Type': 'application/json'
// }
// };
// }
const httpClient: AxiosInstance = axios.create(config);