27 lines
680 B
TypeScript
27 lines
680 B
TypeScript
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
// Directs API calls from Vite (port 5173) to Express (port 3000)
|
|
// Using 127.0.0.1 is more stable than 'localhost' in some environments
|
|
'/api': {
|
|
target: 'http://127.0.0.1:3000',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
// Directs file download calls to the uploads folder served by Express
|
|
'/files': {
|
|
target: 'http://127.0.0.1:3000',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
}
|
|
}
|
|
}
|
|
});
|