Browse Source

Check whether exist registered routes

pull/2752/head
Grey Li 7 years ago committed by David Lord
parent
commit
b4e092600d
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
  1. 4
      flask/cli.py

4
flask/cli.py

@ -825,6 +825,10 @@ def routes_command(sort, all_methods):
"""Show all registered routes with endpoints and methods."""
rules = list(current_app.url_map.iter_rules())
if not rules:
click.echo('No routes were registered.')
return
ignored_methods = set(() if all_methods else ('HEAD', 'OPTIONS'))
if sort in ('endpoint', 'rule'):

Loading…
Cancel
Save