Hey! I had a similar issue with Node Express proxy change request path a while back. What worked for me was using `http-proxy-middleware`'s `pathRewrite` option. You can set it up like this:
```javascript
const { createProxyMiddleware } = require('http-proxy-middleware');
app.use('/api/v1', createProxyMiddleware({
target: 'http://backend-server',
pathRewrite: { '^/api/v1': '/v2' },
}));
```
This will rewrite `/api/v1/something` to `/v2/something`. You can tweak the regex to match your needs. For dynamic paths, you can use a function inside `pathRewrite` to handle it. Hope this helps!
```javascript
const { createProxyMiddleware } = require('http-proxy-middleware');
app.use('/api/v1', createProxyMiddleware({
target: 'http://backend-server',
pathRewrite: { '^/api/v1': '/v2' },
}));
```
This will rewrite `/api/v1/something` to `/v2/something`. You can tweak the regex to match your needs. For dynamic paths, you can use a function inside `pathRewrite` to handle it. Hope this helps!
