- README rewritten for the completed frontend: full setup/run instructions (Docker Compose, local dev with hot reload, prod build), pages/routes, API endpoints, and a consolidated environment-variable reference - Vite dev proxy now targets 127.0.0.1 (avoids the Windows IPv6-localhost pitfall where the SPA could not reach the IPv4-bound API) - Remove server/_setup.ps1 (a scratch script accidentally committed in the previous frontend commit) and gitignore _*.ps1 scratch files Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
20 lines
547 B
JavaScript
20 lines
547 B
JavaScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// In dev, proxy the API + uploads to the Express server so the SPA stays
|
|
// same-origin (cookies work) and matches the production setup where Express
|
|
// serves the built client.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': { target: 'http://127.0.0.1:3000', changeOrigin: true },
|
|
'/uploads': { target: 'http://127.0.0.1:3000', changeOrigin: true },
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
},
|
|
})
|