0
votes

I am having the url handler as below in my app.yaml

handlers:

- url: /_ah/spi/websiteapi/.*
  script: Website.application
  secure: always

But while accessiong the api using http://localhost:8080/_ah/api/websiteapi/v1/websites i am getting error as { "error": { "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
1

1 Answers

0
votes

Requests to /_ah/spi on App Engine need to be handled by a Google Cloud Endpoints server in order to serve the correct responses.

Your script Website.application should be an endpoints.api_server object. Here's a working example:

In app.yaml

handlers:
- url: /_ah/spi/.*
  script: main.endpoints_app

In main.py:

import endpoints
import services  # Your Cloud Endpoints handlers go here.

endpoints_app = endpoints.api_server([
    services.MyService1,
    services.MyService2
])

Full docs are here: https://cloud.google.com/appengine/docs/python/endpoints/getstarted/backend/write_api#coding_a_backend_with_a_simple_get_method