diff --git a/.env_example b/.env_example new file mode 100644 index 000000000..d43edd000 --- /dev/null +++ b/.env_example @@ -0,0 +1,7 @@ +# Local development playwright target +PLAYWRIGHT_TEST_URL=http://localhost:5173 +# PLAYWRIGHT_TEST_URL=http://localhost:8188 + +# Proxy target of the local development server +# Note: localhost:8188 does not work. +DEV_SERVER_COMFYUI_URL=http://127.0.0.1:8188 diff --git a/vite.config.mts b/vite.config.mts index 508bf179f..87e5219d9 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,6 +1,8 @@ import { defineConfig, Plugin } from 'vite'; import { viteStaticCopy } from 'vite-plugin-static-copy' import path from 'path'; +import dotenv from "dotenv"; +dotenv.config(); const IS_DEV = process.env.NODE_ENV === 'development'; @@ -80,7 +82,7 @@ export default defineConfig({ server: { proxy: { '/api': { - target: 'http://127.0.0.1:8188', + target: process.env.DEV_SERVER_COMFYUI_URL || 'http://127.0.0.1:8188', // Return empty array for extensions API as these modules // are not on vite's dev server. bypass: (req, res, options) => {