Fixes vite dev by proxying socket.io

This commit is contained in:
psychedelicious 2022-09-29 15:34:11 +10:00 committed by Lincoln Stein
parent 40430ad29c
commit 3902c467b9

View File

@ -7,12 +7,18 @@ export default defineConfig(({ mode }) => {
const common = {
plugins: [react(), eslint()],
server: {
// Proxy HTTP requests to the flask server
proxy: {
'/outputs': {
target: 'http://localhost:9090/outputs',
target: 'http://127.0.0.1:9090/outputs',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/outputs/, ''),
},
// Proxy socket.io to the flask-socketio server
'/socket.io': {
target: 'ws://127.0.0.1:9090',
ws: true,
},
},
},
build: {