title: How to prevent Flask redirecting to the default port of 5000?
body: <p>I'm trying to run a <a href="https://github.com/microsoftgraph/python-sample-send-mail/issues/3" rel="nofollow noreferrer">Python sample for using Microsoft Graph</a>. It uses Flask libraries for a mini-application that can be run using the Flask's standalone web server. </p>
  
  <p>I've modified the application initialization line as </p>
  
  <pre><code>APP.run(port=9999)
  </code></pre>
  
  <p>And it starts running successfully at <code>http://localhost:9999/</code>, but then after a step, it redirects to <code>http://localhost:5000</code> which is problematic.</p>
  
  <p>If I change the initial part of the URL in my browser to <code>http://localhost:9999</code> and hit ENTER, it continues to function as expected.</p>
  
  <p>How can tell Flask to "redirect to the URL with the port number I declared in APP.run"?</p>