diff --git a/backend/server.js b/backend/server.js index f183f6b..1c2e79d 100644 --- a/backend/server.js +++ b/backend/server.js @@ -37,7 +37,7 @@ const allowedOrigins = process.env.ALLOWED_ORIGINS : ['https://www.ntari.org']; if (process.env.NODE_ENV !== 'production') { - allowedOrigins.push('http://localhost:3000'); + allowedOrigins.push('http://127.0.0.1:3000'); } app.use(cors({ diff --git a/frontend/chat-ui/vite.config.js b/frontend/chat-ui/vite.config.js index 535ba96..5ff8e22 100644 --- a/frontend/chat-ui/vite.config.js +++ b/frontend/chat-ui/vite.config.js @@ -1,21 +1,23 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; +const BACKEND_URL = process.env.BACKEND_URL || 'http://127.0.0.1:5000'; + export default defineConfig({ plugins: [react()], server: { port: 3000, proxy: { '/api': { - target: 'http://localhost:5000', + target: BACKEND_URL, changeOrigin: true }, '/conversations': { - target: 'http://localhost:5000', + target: BACKEND_URL, changeOrigin: true }, '/messages': { - target: 'http://localhost:5000', + target: BACKEND_URL, changeOrigin: true } }