Leitet /v1 an ticket.webklar.com weiter und dokumentiert .env.local, damit Session-Cookies auf localhost wie auf dem Server funktionieren. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
591 B
JavaScript
23 lines
591 B
JavaScript
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
const apiTarget = env.VITE_APPWRITE_PROXY_TARGET || 'https://ticket.webklar.com'
|
|
|
|
return {
|
|
plugins: [react()],
|
|
server: {
|
|
proxy: {
|
|
// Lokal: Appwrite über gleiche Origin wie die App (wie nginx auf dem Server)
|
|
'/v1': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
secure: true,
|
|
cookieDomainRewrite: 'localhost',
|
|
},
|
|
},
|
|
},
|
|
}
|
|
})
|