Removed hardcoded urls

This commit is contained in:
Sean Edmunds
2024-12-04 13:44:35 -06:00
parent 85e9c9134a
commit 1fca2b7688
16 changed files with 262 additions and 178 deletions

View File

@@ -1,29 +1,32 @@
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://localhost:5000/trigger',
changeOrigin: false,
secure: false,
export default defineConfig(({mode}) => {
const env = loadEnv(mode, process.cwd());
return {
plugins: [react()],
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
'/api': {
target: `http://localhost:5000/${env.VITE_BASE_URL}`,
changeOrigin: false,
secure: false,
},
},
},
},
preview: {
port: 3000,
host: '0.0.0.0',
proxy: {
api: {
target: 'http://localhost:5000',
changeOrigin: false,
secure: false,
preview: {
port: 3000,
host: '0.0.0.0',
proxy: {
api: {
target: 'http://localhost:5000',
changeOrigin: false,
secure: false,
},
},
},
},
}
});