diff --git a/.env.example b/.env.example index e121c54..121a98a 100644 --- a/.env.example +++ b/.env.example @@ -14,6 +14,7 @@ VITE_OBP_REDIS_URL = redis://127.0.0.1:6379 # Enable the chatbot interface "Opey" VITE_CHATBOT_ENABLED=false +VITE_CHATBOT_ENDPOINT_URL=http://localhost:5000 # Product styling setting #VITE_OBP_LINKS_COLOR="#52b165" diff --git a/vite.config.ts b/vite.config.ts index d8ff8b9..dce92e1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -43,6 +43,11 @@ export default defineConfig({ changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), }, + '^/opey': { + target: import.meta.env.VITE_CHATBOT_ENDPOINT_URL, + changeOrigin: true, + rewrite: (path) => path.replace(/^\/opey/, ''), + }, }, }, })