title: How to redirect to a new link from a POST endpoint in express?
body: <p>I am using react in frontend and express for the backend.
  I have a problem with redirecting from a POST endpoint in express app to a link in my react app.</p>
  <p><strong>More Explanation</strong>: I am integrating with a payment service and after the transaction happened on the third-party website, the service will send me a POST request with the transaction status and it will redirect the user to that endpoint too.
  So I am planning to receive the transaction status in express and redirect the user back to my react app in frontend.</p>
  <p><strong>Note</strong> : redirect() function didn't work for me</p>
  <pre><code>// The route for recieving payment response
      app.get(&quot;/payment/response&quot;, (req, res) =&gt; {
        try {
          // receiving the transaction body in here and
          // redirecting the user to my react website 
          // The below codes are not working
          // return res.status(200).json({
          //   success: true,
          //   redirectUrl: &quot;http://localhost:2200/user&quot;,
          // });
          // res.status(301).redirect(&quot;https://www.google.com&quot;);
          // return res.status(200).json({
          //   success: true,
          //   redirectUrl: &quot;&quot;,
          // });
        } catch (error) {
          res.status(500).json(&quot;Something went wrong&quot;);
        }
      });
  </code></pre>