Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python GAE模块和Google端点_Python_Google App Engine_Module_Routing_Google Cloud Endpoints - Fatal编程技术网

Python 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

我正在将一个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 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请求(
    /\u ah/spi/xxx
    )将通过404发送到默认模块
  • 奇怪的是,当启动应用程序时,我可以在
    api
    实例的日志中看到
    /\u ah/spi/BackendService.logMessages
    的200 OK
从日志中,我还看到:

  • 前面的日志消息200 OK来自
    alpha.api.testapp.appspot.com
  • api
    模块的404来自
    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