You can follow this guideline: https://flask.palletsprojects.com/en/1.1.x/api/#url-route-registrations
from flask import Flask app = Flask(__name__) @app.route('/', defaults={'path': ''}) @app.route('/<path:path>') def catch_all(path): return 'You want path: %s' % path if __name__ == '__main__': app.run()
2.1m questions
2.1m answers
60 comments
57.0k users