-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
23 lines (22 loc) · 770 Bytes
/
Copy pathvite.config.js
File metadata and controls
23 lines (22 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
// In development, /api requests are proxied to the FastAPI server so the
// browser talks to a same-origin endpoint and never holds an API key.
// In production the app is served same-origin behind a reverse proxy, so the
// relative /api/chat path resolves to the same backend without any change.
export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api': {
target: process.env.VITE_API_PROXY_TARGET || 'http://localhost:8000',
changeOrigin: true,
},
'/detect_emotion': {
target: process.env.VITE_API_PROXY_TARGET || 'http://localhost:8000',
changeOrigin: true,
},
},
},
})