def add_route(route, endpoint=None, **kw):
def wrapper(f):<EOL><INDENT>try:<EOL><INDENT>router.DefaultRouter.add_url_rule(route,<EOL>endpoint=endpoint,<EOL>view_func=f,<EOL>options=kw)<EOL><DEDENT>except AssertionError as e:<EOL><INDENT>logger.warn("<STR_LIT>".format(route, e))<EOL><DEDENT>return f<EOL><DEDENT>return wrapper<EOL>
Add a new JSON API route