I was starting a simple Flask app and successfully hosted it locally at port 5000.
However, I couldn't set up a tunnel to a public url via ngrok.
Here are my codes:
app = Flask(__name__)
@app.route("/")
def hello_world():
return "<p>Hello, World!!</p>"
if __name__ == '__main__':
app.run(debug=True)
My local host is showing "Hello World!!" normally but clicking on the ngrok page shows this:
There is an issue where the latest mac os mojave uses the default port for flask. To resolve it, head over to System Preferences > Sharing and unselect the AirPlay Receiver. Or change your default flask port to something other than 5000 using flask run --port=5002 and restart your ngrok server: ngrok http 5002