diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..04bd733 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_BASE_URL = "/api" \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..56ffd93 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VITE_BASE_URL = "/" \ No newline at end of file diff --git a/src/utils/network.ts b/src/utils/network.ts index 39f99a2..ce6e7c5 100644 --- a/src/utils/network.ts +++ b/src/utils/network.ts @@ -2,7 +2,7 @@ import axios, {AxiosError, AxiosRequestConfig} from 'axios' export async function request(config: AxiosRequestConfig): Promise { const instance = axios.create({ - baseURL: "/api", + baseURL: import.meta.env.VITE_BASE_URL, timeout: 5000, headers: {}, })