forked from orbit-oss/flask
Check whether exist registered routes
This commit is contained in:
parent
a6a6810d56
commit
b4e092600d
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue