【发布时间】:2013-08-31 07:25:31
【问题描述】:
我有以下路线设置,匹配 /rest 上的休息 api。
routes = [
PathPrefixRoute('/rest', [
Route('/customers', handler='app.handlers.CustomerHandler:list',
methods=['GET']),
# some other /rest routers
Route('/<:.*>', ?) # this route should execute abort(404)
]),
Route('/<page:.*>', handler='app.handlers.PageHandler', methods=['GET'])
]
如果有人访问/rest/does_not_exists url,我想显示 404。
有没有办法从路由调用 abort(404) 或者我应该为此创建一个处理程序?
【问题讨论】:
标签: python google-app-engine python-2.7 webapp2