Spaces:
Running
Running
Download frontend/src/setupProxy.js from xenecode/Jaguar_Project: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/frontend/src/setupProxy.js
- Command line
-
hf download hf://spaces/xenecode/Jaguar_Project/frontend/src/setupProxy.js
-
curl -L -o setupProxy.js https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/frontend/src/setupProxy.js
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, | |
| }) | |
| ); | |
| }; | |