title: How to accept empty url route in flask?
body: <p>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.</p>
  
  <p>For starters, I made the following server in Flask</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I was getting a 308 error:</p>
  
  <p><img src="https://i.stack.imgur.com/K1gLR.png" alt="error 308"></p>
  
  <p>Then I used the following catch-all url approach to help my case.</p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  
  
  @app.route("/", defaults={"path": ""},methods=['GET', 'POST', 'DELETE', 'PATCH'])
  @app.route("/&lt;string:path&gt;",methods=['GET', 'POST', 'DELETE', 'PATCH'])
  @app.route("/&lt;path:path&gt;",methods=['GET', 'POST', 'DELETE', 'PATCH'])
  def hello_world():
      return 'Hello World!'
  
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0',port=5000)
  </code></pre>
  
  <p>But still, I am getting the same error:</p>
  
  <p><img src="https://i.stack.imgur.com/K1gLR.png" alt="the error"></p>