How to Modify the Request Path in a Node Express Proxy Setup?

16 Replies, 1353 Views

Hey everyone,

So I’m working on a Node Express proxy setup, and I need to *modify the request path* before it gets forwarded. Like, the incoming request has `/api/v1/something`, but I wanna change it to `/v2/something-else` before it hits the backend.

I’ve been googling around for "Node Express proxy change request path," but most examples are either too basic or don’t cover this specific case.

Anyone know how to tweak the path in the proxy middleware? I’m using `http-proxy-middleware`, but open to other solutions too.

Also, is there a way to do it dynamically based on the request? Or do I have to hardcode the paths?

Thanks in advance! 🙏

Messages In This Thread
How to Modify the Request Path in a Node Express Proxy Setup? - by - 25-07-2024, 08:03 PM



Users browsing this thread: 1 Guest(s)