mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
change route call method
This commit is contained in:
parent
22c3727784
commit
e22620b147
@ -27,12 +27,9 @@ api = Blueprint("api", __name__)
|
||||
def api_routing(endpoint):
|
||||
def decorator(func):
|
||||
viewendpoint="{}.view".format(endpoint)
|
||||
@api.route(endpoint, methods=["GET", "POST"])
|
||||
@api.route(viewendpoint, methods=["GET", "POST"])
|
||||
@functools.wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
return func(*args,**kwargs)
|
||||
return wrapper
|
||||
api.add_url_rule(endpoint,view_func=func, methods=["GET", "POST"])
|
||||
api.add_url_rule(viewendpoint,view_func=func, methods=["GET", "POST"])
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user