Search code examples
pythongoogle-app-enginehttp-status-code-404google-cloud-endpoints

I'm getting a 404 in google cloud endpoints on app engine


In my app, the app.yaml (the relevant part) looks like this:

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /logs
  script: logviewer.main.app

- url: /static
  static_dir: static

- url: /(.*\.html)
  static_files: pages/\1
  upload: pages/(.*\.html)

- url: /_ah/spi/.*
  script: api.application

- url: .*
  script: main.app

I've included all handlers, just to make sure, but I'm quite certain that app.yml isn't the problem.

The relevant part of api.py

@endpoints.api(name='quizservice',version='v01',
               description='api backand for quickbuzzer')
class QuizService(remote.Service):


  @endpoints.method(messages.VoidMessage , messages.CreateQuizResponse, name="createQuiz")
  def createQuiz(self, request):
    . . .

application = endpoints.api_server([QuizService],
                                restricted=False)

Now, when I visit the explorer and try running the QuiizService.createQuiz method, I get a 404 back.

Looking at the logs, I see this:

INFO     2013-04-29 17:53:15,560 server.py:561] default: "GET /_ah/api/discovery/v1/apis/quizservice/v01/rest HTTP/1.1" 200 2738
INFO     2013-04-29 17:53:22,118 server.py:561] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 200 1585
WARNING  2013-04-29 17:53:22,119 api_config_manager.py:201] No endpoint found for path: quizservice/v01
INFO     2013-04-29 17:53:22,119 server.py:561] default: "POST /_ah/api/quizservice/v01 HTTP/1.1" 404 9

Solution

  • I was able to solve the issue by supplying a path parameter to the endpoints.method decorator. What I'm wondering now, is if the endpoints api could choose a default path based on my method name.