Corrige los proxies de /api y /ws para apuntar al servidor Colyseus en puerto 2567 en lugar del puerto 3000. Esto resuelve el problema de que las APIs del admin devolvían HTML en lugar de JSON.
27 lines
693 B
TypeScript
27 lines
693 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 3004,
|
|
allowedHosts: ['z590.interno.com', 'snatchgame.interno.com'],
|
|
cors: {
|
|
origin: ['http://localhost:3004', 'http://z590.interno.com:3004']
|
|
},
|
|
proxy: {
|
|
'/api': {
|
|
target: process.env.VITE_DEV_API_PROXY_TARGET || 'http://localhost:2567',
|
|
changeOrigin: true
|
|
},
|
|
'/ws': {
|
|
target: process.env.VITE_DEV_WS_PROXY_TARGET || 'http://localhost:2567',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
rewrite: (path) => path.replace(/^\/ws/, '')
|
|
}
|
|
}
|
|
}
|
|
})
|