mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
12 lines
365 B
Python
12 lines
365 B
Python
|
|
from flask import current_app
|
||
|
|
|
||
|
|
|
||
|
|
def list_routes():
|
||
|
|
"""List URLs of all application routes."""
|
||
|
|
for rule in sorted(current_app.url_map.iter_rules(), key=lambda r: r.rule):
|
||
|
|
print("{:10} {}".format(", ".join(rule.methods - set(['OPTIONS', 'HEAD'])), rule.rule))
|
||
|
|
|
||
|
|
|
||
|
|
def setup_commands(application):
|
||
|
|
application.cli.command('list-routes')(list_routes)
|