// 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, }) ); };