diff --git a/src/api/axiosInstance.ts b/src/api/axiosInstance.ts index 4e949ff..14b53f7 100644 --- a/src/api/axiosInstance.ts +++ b/src/api/axiosInstance.ts @@ -9,7 +9,7 @@ interface IRefreshResponse { message: string; } export const axiosInstance = axios.create({ - baseURL: '/api', + baseURL: import.meta.env.VITE_API_BASE_URL, withCredentials: true, }); diff --git a/vite.config.ts b/vite.config.ts index 490f43d..5a00583 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,29 +1,17 @@ import tailwindcss from '@tailwindcss/vite'; import react from '@vitejs/plugin-react-swc'; -import { defineConfig, loadEnv } from 'vite'; +import { defineConfig } from 'vite'; import svgr from 'vite-plugin-svgr'; -export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ''); - const target = env.VITE_API_BASE_URL; - return { - plugins: [react(), svgr({ include: '**/*.svg?react' }), tailwindcss()], - server: { - host: '0.0.0.0', - port: 5173, - proxy: { - '/api': { - target, - changeOrigin: true, - secure: true, - rewrite: (path) => path.replace(/^\/api/, ''), - }, - }, +export default defineConfig({ + plugins: [react(), svgr({ include: '**/*.svg?react' }), tailwindcss()], + server: { + host: '0.0.0.0', + port: 5173, + }, + resolve: { + alias: { + '@': '/src', }, - resolve: { - alias: { - '@': '/src', - }, - }, - }; + }, });