0
votes

I am creating endpoint APIs using GAE Cloud Endpoints Framework

My current app.yaml Endpoint Handler looks like

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

and the api call look like GET http://localhost:8080/_ah/api/proj_name/v1/api_name

Is it possible to remove the _ah part of the API url?

If yes, How?

3

3 Answers

0
votes

The _ah URL is typically reserved for internal API calls. If you are building your own custom APIs, you can select any URL you want... You could simply add another line to app.yaml that looks like....

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

(I like to put APIs into a separate api.py file. You could also leave it as main.application)

0
votes

This page provides detailed configuration and deployment procedures for changing the version number of your API https://cloud.google.com/endpoints/docs/openapi/versioning-an-api

0
votes

No, it is not possible.

Based on the url you mention you seem to be using the Cloud Endpoints Frameworks v1 (deprecated, soon to be shutdown, BTW). From Required Files and Configuration (where you can see the deprecation note as well):

Note: In the following sections, we refer to the path/_ah/spi. If you have created App Engine apps that are not Endpoints, you may be expecting the path /_ah/api and not the path /_ah/spi as described above. This is not a typo: Endpoints require /_ah/spi!

And even after migrating to the newer version you still won't be able to get rid of the /_ah/ portion. From Migrating from Cloud Endpoints version 1.0:

  1. In the handlers section in app.yaml, change the url directive from - url: /_ah/spi/.* to - url: /_ah/api/.*.