I am working with hardware machines whose firmware cannot be changed. I am supposed to make a server from them the only thing I can configure is IP and port.
For starters, I made the following server in Flask
from flask import Flask
app = Flask(__name__)
@app.route("/" ,methods=['GET', 'POST', 'DELETE', 'PATCH'])
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(host='0.0.0.0',port=5000)
I was getting a 308 error:

Then I used the following catch-all url approach to help my case.
from flask import Flask
app = Flask(__name__)
@app.route("/", defaults={"path": ""},methods=['GET', 'POST', 'DELETE', 'PATCH'])
@app.route("/<string:path>",methods=['GET', 'POST', 'DELETE', 'PATCH'])
@app.route("/<path:path>",methods=['GET', 'POST', 'DELETE', 'PATCH'])
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(host='0.0.0.0',port=5000)
But still, I am getting the same error:
