title: Use http-proxy-middleware to forward Express request changing only port
body: <p>This is for a NodeJS, Express application.</p>
  <p>I want to take a request coming into a path like
  <a href="https://mycompany.com/cost-recovery" rel="nofollow noreferrer">https://mycompany.com/cost-recovery</a> -&gt; <a href="http://mycompany.com:8447/cost-recovery" rel="nofollow noreferrer">http://mycompany.com:8447/cost-recovery</a>. I wish to pass all headers, request bodies, etc. over to this forwarded host. Essentially the only thing I'm doing is changing the port.</p>
  <p>I looked at http-proxy-middleware, but wasn't sure how to approach this. I wasn't sure what the router option does. Also, if there are any query strings I'm not sure they'll get passed. The problem with this service is that it doesn't look like I can take an incoming request and generate the proxy. Or at least, I don't know how. If I could, I'd build the proxy as a handler based on the incoming request.</p>
  <p>Not looking for a full coding snippet, just a clue on what section to look for. Or if you do have an example, I'd like to see it.</p>