def get_sitemap(app, excludes=("/", "/static/<path:filename>")):
    """Returns a sitemap for the given application.

    Args:
        app (flask.Flask): Application to be scanned.
        excludes (tuple):  Tuple of endpoints to be hidden.

    Returns:
        list: Returns a list containing valid endpoint urls and their methods. Example:

            [
                {"url": "/",         "methods": ["GET"]},
                {"url": "/username", "methods": ["GET", "POST"]}
            ]
    """
    endpoints = []
    for rule in app.url_map.iter_rules():
        if str(rule) in excludes:
            continue

        endpoint = {}
        endpoint["url"]     = str(rule)
        endpoint["methods"] = ",".join(rule.methods)

        endpoints.append(endpoint)

    endpoints.sort(key= lambda i: i["url"])

    return endpoints