Files
Digitaltwin/web/vite.config.js
T

17 lines
543 B
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
// The API and the telemetry socket live on the server process. Proxying them
// keeps the browser on one origin, so there is no CORS setup to go wrong on
// stage and the copilot API key never leaves the server.
proxy: {
'/api': { target: 'http://localhost:8787', changeOrigin: true },
'/ws': { target: 'ws://localhost:8787', ws: true },
},
},
});