首页 > 解决方案 > Google App Engine dispatch.yaml 意外属性“服务”

问题描述

我无法让我的 dispatch.yaml 文件在本地 devappserver 上运行。我有两个错误,一个似乎与缩进有关, expecting <block end>, but found ?我可以通过删除如下所示的调度文件中的缩进来解决这个问题。

第二个问题发生在我删除了我得到的缩进我Unexpected attribute 'service' of type DispachInfoExternal尝试从谷歌文档中复制示例但我得到了同样的错误,我也尝试将名称服务更改为模块,因为我相信这是旧名称,我得到了同样的错误。我使用 Atom 作为我的编辑器。

dispatch:
- url: '*/content/*'
service: default

- url: '*/admin/*'
service: admin-services

- url: '*/creator/*'
service: creator-services

- url: '*/social/*'
service: social-services

- url: '*/subs/*'
service: subscription-services

- url: '*/user/*'
service: user-services

标签: google-app-engineyamldev-appserver

解决方案


您缺少yaml 文件中的缩进。

写的不一样

dispatch:
- url: '*/content/*'
service: default

dispatch:
- url: '*/content/*'
  service: default

推荐阅读