我的app.yaml
中有url处理程序handlers:
- url: /_ah/spi/websiteapi/.*
script: Website.application
secure: always
但是当使用http://localhost:8080/_ah/api/websiteapi/v1/websites访问api时,我会收到错误 { "错误":{ " message":" BackendService.getApiConfigs Error" } }
Help me to configure mt url handler and the below setting works fine but i need to handle several scripts depending on the url.
- url: /_ah/spi/.*
script: Website.application
secure: always
答案 0 :(得分:0)
App Engine上/_ah/spi
的请求需要由Google Cloud Endpoints服务器处理,以便提供正确的响应。
您的脚本Website.application
应该是endpoints.api_server
个对象。这是一个有效的例子:
在app.yaml
handlers:
- url: /_ah/spi/.*
script: main.endpoints_app
在main.py
:
import endpoints
import services # Your Cloud Endpoints handlers go here.
endpoints_app = endpoints.api_server([
services.MyService1,
services.MyService2
])