Search code examples
google-app-enginegoogle-cloud-endpointsopenapi

Deployed Google Endpoints Quickstart app giving error message when i request url?


I am following the Quickstart for Cloud Endpoints Frameworks on App Engine in standard environment. I have deployed the sample API. When I open https://[my-project].appspot.com/ I get the error message:

Error: Not Found. The Requested URL / was not found on this server

The logs show the message:

No Handlers matched this url

The app.yaml handlers are the what came with the endpoints-frameworks-v2/echo sample:

  handlers:
# The endpoints handler must be mapped to /_ah/api.
- url: /_ah/api/.*
  script: main.api

I was having great difficulty generating the OpenAPI configuration file in a previous step of the quickstart. I got it to work by updating the system variable path for the SDK but I did get this error:

No handlers could be found for logger "endpoints.apiserving"
WARNING:root:Method echo.echo_path_parameter specifies path parameters buy you are
not using a ResourceContainer. This will fail in future releases; please
switch to using ResourceContainer as soon as possible. 

I have no idea if this error is relavant to the current problem.

Any help would be much appreciated.


Solution

  • You need a url handler for / if that is a valid url:

    handlers:
    # The endpoints handler must be mapped to /_ah/api.
    - url: /_ah/api/.*
      script: main.api
    
    - url: /.*            # catchall for all other urls
      script: main.api    # or wherever you handle the request for `/` and others