Esempio n. 1
0
def register_routes():
    r = {}
    # 注册外部的路由
    r.update(todo_api())
    r.update(todo_routes())
    r.update(weibo_api())
    r.update(weibo_routes())
    r.update(user_routes())
    r.update(public_routes())
    return r
Esempio n. 2
0
def response_for_path(request):
    """
    根据 path 调用相应的处理函数
    没有处理的 path 会返回 404
    """
    r = {}
    # 注册外部的路由
    r.update(todo_routes())
    r.update(todo_api())
    r.update(user_routes())
    r.update(static_routes())
    response = r.get(request.path, error)
    return response(request)
Esempio n. 3
0
def response_for_path(request):
    """
    根据 path 调用相应的处理函数
    没有处理的 path 会返回 404
    """
    r = {}
    # 注册外部的路由
    r.update(todo_api())
    r.update(todo_routes())
    r.update(weibo_routes())
    r.update(user_routes())
    r.update(public_routes())
    response = r.get(request.path, error)
    # log('request', request, response)
    return response(request)