Spaces:
Running
Running
| import { resolve } from "node:path"; | |
| import react from "@vitejs/plugin-react"; | |
| import { defineConfig, loadEnv } from "vite"; | |
| export default defineConfig(({ mode }) => { | |
| const env = loadEnv(mode, process.cwd(), ""); | |
| const apiProxy = env.VITE_API_PROXY || "http://127.0.0.1:7860"; | |
| return { | |
| plugins: [react()], | |
| resolve: { | |
| alias: { | |
| "@": resolve(__dirname, "src"), | |
| }, | |
| }, | |
| server: { | |
| host: "0.0.0.0", | |
| port: 5173, | |
| proxy: { | |
| "/api": { | |
| target: apiProxy, | |
| changeOrigin: true, | |
| }, | |
| "/health": { | |
| target: apiProxy, | |
| changeOrigin: true, | |
| }, | |
| }, | |
| }, | |
| }; | |
| }); | |