Expose this function to the web layer.

def expose(url_rule, endpoint=None, **kwargs):
    """Expose this function to the web layer."""

    def decorate(f):
        e = endpoint or f.__name__
        endpoints[e] = f
        url_map.add(Rule(url_rule, endpoint=e, **kwargs))
        return f

    return decorate