I have the minimal flask app as:
from flask import Flask
app = Flask(__name__)
@app.route('/index')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run()
On running the app(locally) it open's on http://127.0.0.1:5000
and have to add /index
explicitly to show 'Hello, World!'
But , Is there a way to directly open with /index
added ?
I have seen other examples and I tried with another decorator as :
@app.route('/')
@app.route('/index')
def hello_world():
return 'Hello, World!'
This open's the same /index
with out explicitly adding it, but I need to have the trailing /index
added in URL and show the Hello, World
....Hope this Q makes sense
Any help is appreciated , TIA