uploadv2 / vite.config.ts
marriedtermiteblyi's picture
Update vite.config.ts
735b59c verified
raw
history blame contribute delete
777 Bytes
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' // hoặc vue tùy project của bạn
export default defineConfig({
plugins: [react()],
server: {
host: '0.0.0.0', // Bắt buộc để chạy trên Docker
port: 5173,
allowedHosts: [
'twanapi-uploadv2.hf.space',
],
proxy: {
// Cấu hình Proxy: Mọi request bắt đầu bằng /api sẽ được chuyển sang Backend
'/api': {
target: 'http://localhost:3001', // Port của Backend
changeOrigin: true,
secure: false,
},
// Nếu bạn có dùng socket.io thì thêm đoạn này, không thì bỏ qua
'/socket.io': {
target: 'http://localhost:3001',
ws: true,
}
},
},
})