Files
tickte-system/vite.config.js
Webklar Deploy d2e7088146 Vite-Proxy für lokale Appwrite-Entwicklung
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>
2026-05-22 18:23:37 +00:00

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',
},
},
},
}
})