Skip to content
Myr

Check whether exist registered routes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Grey Li · committed by David Lord · parent a6a6810 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:flask/cli.py+4 added
823 unmodified lines
824def routes_command(sort, all_methods):825 """Show all registered routes with endpoints and methods."""826827 rules = list(current_app.url_map.iter_rules())828 if not rules:829 click.echo('No routes were registered.')830 return831832 ignored_methods = set(() if all_methods else ('HEAD', 'OPTIONS'))833834 if sort in ('endpoint', 'rule'):835 rules = sorted(rules, key=attrgetter(sort))
63 unmodified lines