From 2fb71b6f0f54e5834713621151ee53dde8b43ba7 Mon Sep 17 00:00:00 2001 From: girst Date: Thu, 30 Jul 2020 09:38:19 +0200 Subject: [PATCH] add a way to print all routes in their order of precedence --- app/__main__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/__main__.py b/app/__main__.py index 6999808..15bd1a4 100755 --- a/app/__main__.py +++ b/app/__main__.py @@ -14,4 +14,9 @@ if __package__ is None: # called as ./__main__.py from app import app if __name__ == '__main__': + import sys + if '--routes' in sys.argv: + for rule in app.url_map.iter_rules(): + print(f"{rule.endpoint}\t{rule.rule}") + sys.exit(0) app.run(debug=True, port=8000, host="0.0.0.0") -- 2.39.3