Messenger/packages/web/vite.config.ts
Заид Омар Медхат | Zaid Omar Medhat 96d496bf26 Realtime connection
2026-07-10 15:04:36 +05:00

21 lines
644 B
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// Proxy API + realtime through the dev server so the browser talks to a single
// origin (localhost:5173). This lets the httpOnly refresh cookie work over http
// with SameSite=Lax instead of requiring cross-origin SameSite=None; Secure.
export default defineConfig({
plugins: [react()],
server: {
host: true,
port: 5173,
proxy: {
'/api': { target: 'http://localhost:8080', changeOrigin: true },
'/connection/websocket': {
target: 'http://localhost:8080',
changeOrigin: true,
ws: true,
},
},
},
});