1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-10 04:02:17 +00:00

change route call method

This commit is contained in:
vincent 2021-01-16 09:44:06 +01:00
parent 22c3727784
commit e22620b147

View File

@ -27,12 +27,9 @@ api = Blueprint("api", __name__)
def api_routing(endpoint): def api_routing(endpoint):
def decorator(func): def decorator(func):
viewendpoint="{}.view".format(endpoint) viewendpoint="{}.view".format(endpoint)
@api.route(endpoint, methods=["GET", "POST"]) api.add_url_rule(endpoint,view_func=func, methods=["GET", "POST"])
@api.route(viewendpoint, methods=["GET", "POST"]) api.add_url_rule(viewendpoint,view_func=func, methods=["GET", "POST"])
@functools.wraps(func) return func
def wrapper(*args, **kwargs):
return func(*args,**kwargs)
return wrapper
return decorator return decorator