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 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({ export default defineConfig({
server: { server: {
proxy: { proxy: {
'/api': { '/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 // Return empty array for extensions API as these modules
// are not on vite's dev server. // are not on vite's dev server.
bypass: (req, res, options) => { bypass: (req, res, options) => {
@@ -93,7 +95,7 @@ export default defineConfig({
}, },
}, },
'/ws': { '/ws': {
target: 'ws://127.0.0.1:8188', target: DEV_SERVER_COMFYUI_URL,
ws: true, ws: true,
}, },
} }