~fmartingr/openshift-sample-app

97670a0b028e2d4bb20398108ea46ed6536df189 — Felipe Martin 2 months ago 8af60ca
Fixed / route with better format and sorting
2 files changed, 2 insertions(+), 2 deletions(-)

M app.py
M templates/index.j2
M app.py => app.py +1 -1
@@ 12,7 12,7 @@ app.url_map.add(Rule("/request", endpoint="request"))
def root_view():
    """List all available routes"""
    routes = {}
    for rule in app.url_map.iter_rules():
    for rule in sorted(app.url_map.iter_rules(), key=lambda rule: rule.rule):
        if rule.endpoint != "static":
            # Get only the first line from the docstring as the summary
            routes[rule.rule] = list(

M templates/index.j2 => templates/index.j2 +1 -1
@@ 4,7 4,7 @@
<body>
<ul>
{% for path, help in routes.items() %}
<li><a href="{{ path }}"> {{ help }}</li>
<li><a href="{{ path }}">{{ path }}</a>: {{ help }}</li>
{% endfor %}
</ul>
</body>