'A decorator to register a function as an endpoint.
Example::
@app.endpoint(\'example.endpoint\')
def example():
return "example"
:param endpoint: the name of the endpoint'

@setupmethod
def endpoint(self, endpoint):

    def decorator(f):
        self.view_functions[endpoint] = f
        return f
    return decorator
