How to Modify the Request Path in a Node Express Proxy? Need Help with 'node express proxy change request path'![/b

10 Replies, 2204 Views

Wow, thanks so much, everyone! I tried the `http-proxy-middleware` with the `pathRewrite` function, and it worked like a charm. I was able to dynamically change the request path just like I wanted.

I did have one follow-up question though—what if I need to handle multiple path changes dynamically? Like, `/api/v1/users` to `/v2/users` and `/api/v1/posts` to `/v2/posts`? Would I need to chain multiple `pathRewrite` functions, or is there a cleaner way to handle this?

Thanks again for all the help! You guys are awesome. 🙌

Messages In This Thread



Users browsing this thread: 1 Guest(s)