diff --git a/client/src/setupProxy.js b/client/src/setupProxy.js index da75db0..f404813 100644 --- a/client/src/setupProxy.js +++ b/client/src/setupProxy.js @@ -1,14 +1,17 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = (app) => { - app.use( - createProxyMiddleware({ - target: 'http://127.0.0.1:8000', - changeOrigin: true, - pathFilter: (path) => - path.startsWith('/api') || - path.startsWith('/static/uploads') || - path.startsWith('/static/explain'), - }) - ); + const proxy = createProxyMiddleware({ + target: 'http://127.0.0.1:8000', + changeOrigin: true, + }); + + // Filter before proxying so both v2 and v3 preserve frontend routes. + app.use((req, res, next) => { + const path = req.path; + const isBackendPath = ['/api', '/static/uploads', '/static/explain'].some( + (prefix) => path === prefix || path.startsWith(`${prefix}/`) + ); + return isBackendPath ? proxy(req, res, next) : next(); + }); }; \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4a044d2..ec94ed7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: - redis react: - image: seoyunje/deepguard-react:1.0.17 + image: seoyunje/deepguard-react:1.0.18 container_name: deepguard-react networks: [deepguard-network] ports: