Python GAE模块和Google端点
我正在将一个GAE应用程序迁移到模块,并且在基于Google端点的Python GAE模块和Google端点,python,google-app-engine,module,routing,google-cloud-endpoints,Python,Google App Engine,Module,Routing,Google Cloud Endpoints,我正在将一个GAE应用程序迁移到模块,并且在基于Google端点的api模块的路由方面存在问题 基本上,我的所有API查询都被路由到默认模块,而其他路由工作正常 我的文件夹结构是 - /gae -- dispatch.yaml -- www/ ---- www.yaml ---- [www module files] -- foo/ ---- foo.yaml ---- [foo module files] -- api/api.yaml ---- api.yaml ---- [foo modu
api
模块的路由方面存在问题
基本上,我的所有API查询都被路由到默认模块,而其他路由工作正常
我的文件夹结构是
- /gae
-- dispatch.yaml
-- www/
---- www.yaml
---- [www module files]
-- foo/
---- foo.yaml
---- [foo module files]
-- api/api.yaml
---- api.yaml
---- [foo module files]
亚马尔
application: testapp
dispatch:
- url: "testapp.appspot.com/"
module: default
- url: "*/_ah/spi/*"
module: api
- url: "*/_ah/api/*"
module: api
- url: "*/foo/*"
module: foomodule
我正在和你一起部署
cd gae
appcfg.py update www/www.yaml upload/upload.yaml api/api.yaml
appcfg.py update_dispatch .
我可以看到部署了3个实例(每个模块一个)
但是:
- 查询(例如)已正确路由到默认模块/实例
/foo/xxx由foo模块处理
- API请求(
)将通过404发送到默认模块/\u ah/spi/xxx
- 奇怪的是,当启动应用程序时,我可以在
实例的日志中看到api
的200 OK/\u ah/spi/BackendService.logMessages
- 前面的日志消息200 OK来自
alpha.api.testapp.appspot.com
模块的404来自api
testapp.appspot.com
- 然而,非默认模块的200 OK也来自``testapp.appspot.com`
我做错什么了吗?Google端点用作模块时是否需要特殊路由?正如我看到的API是默认模块,在“必须首先上载默认模块”中,您还需要将参数“module:default”放入yaml文件中,或者根本不包括在内 试一试
appcfg.py update api/api.yaml www/www.yaml upload/upload.yaml #api first
appcfg.py update_dispatch