I feel you on the Node Express proxy change request path struggle! I ended up using a custom middleware before the proxy to modify the path. Something like this:
```javascript
app.use('/api/v1', (req, res, next) => {
req.url = req.url.replace('/api/v1', '/v2');
next();
});
app.use('/api/v1', createProxyMiddleware({ target: 'http://backend-server' }));
```
This way, you can do any crazy logic you want before the request hits the proxy. It’s a bit manual, but super flexible.
```javascript
app.use('/api/v1', (req, res, next) => {
req.url = req.url.replace('/api/v1', '/v2');
next();
});
app.use('/api/v1', createProxyMiddleware({ target: 'http://backend-server' }));
```
This way, you can do any crazy logic you want before the request hits the proxy. It’s a bit manual, but super flexible.
