Fix ws dev server URL (#213)

This commit is contained in:
Chenlei Hu
2024-07-24 11:01:22 -04:00
committed by GitHub
parent 5b4e96f6c5
commit 84d8c5fc16

View File

@@ -78,11 +78,13 @@ function getModuleName(id: string): string {
return fileName.replace(/\.\w+$/, ''); // Remove file extension
}
const DEV_SERVER_COMFYUI_URL = process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188';
export default defineConfig({
server: {
proxy: {
'/api': {
target: process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188',
target: DEV_SERVER_COMFYUI_URL,
// Return empty array for extensions API as these modules
// are not on vite's dev server.
bypass: (req, res, options) => {
@@ -93,7 +95,7 @@ export default defineConfig({
},
},
'/ws': {
target: 'ws://127.0.0.1:8188',
target: DEV_SERVER_COMFYUI_URL,
ws: true,
},
}