Nice Work

This commit is contained in:
2026-01-13 20:26:56 +00:00
parent d88a319d37
commit 0a4a1d3e48
5 changed files with 88 additions and 66 deletions
+20 -8
View File
@@ -1,11 +1,23 @@
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: {
host: true,
port: 5174,
strictPort: true,
},
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const rawTarget = env.VITE_BACKEND_URL || 'http://127.0.0.1:5001';
const apiTarget = rawTarget.replace(/\/api\/?$/, '');
return {
plugins: [react()],
server: {
host: true,
port: 5174,
strictPort: true,
proxy: {
'/api': {
target: apiTarget,
changeOrigin: true,
},
},
},
};
});