Jaguar_Project / frontend /src /setupProxy.js
xenecode's picture
Claude Opus 5.5
Translate frontend and backend text to English
6c68d01
Raw History Blame Contribute Delete
513 Bytes
// Forwards dev server (npm start) requests to the Flask container.
// Defined here with ws: true because the package.json "proxy" field does not forward the socket.io WebSocket connection.
const { createProxyMiddleware } = require('http-proxy-middleware');
const BACKEND_URL = process.env.BACKEND_URL || 'http://localhost:7860';
module.exports = function (app) {
app.use(
createProxyMiddleware(['/api', '/socket.io'], {
target: BACKEND_URL,
changeOrigin: true,
ws: true,
})
);
};