0

I am running a Flask app.

    app = Flask(__name__)
    app.run(host="0.0.0.0", port="5000")

    @app.route('/list', methods=['GET'])
    def get_all_list():
      star = mongo.db.listdata

    if __name__ == '__main__':
        app.run(debug=True)

My public IP :- 100.x.x.x

When I am accessing 100.x.x.x:500/list it is giving me 404 not found. Server is running, as I can see the request in the flask console. But it is giving 404 to all routes.

Dinesh Ahuja
  • 925
  • 3
  • 15
  • 29
  • You are probably behind a NAT and port 5000 by default is the UPnP port, getting a 404 response means your router/gateway actually has the real IP and it is somehow running HTTP on port 5000 and it handled the response for you. – metatoaster Aug 20 '18 at 00:24

1 Answers1

0

Try this.

app = Flask(__name__)

@app.route('/list', methods=['GET'])
def get_all_list():
    star = mongo.db.listdata

if __name__ == '__main__':
    app.run(host="0.0.0.0", port="5000", debug=True)
dao leno
  • 261
  • 2
  • 5