How do I access Google cloud endpoints on a non-default local Google App Engine module?

I am developing a Google App Engine application with several modules. Back-end APIs use Google Cloud endpoints. When I start the GAE server locally, even if I load the API from my admin module (localhost: 9090) after loading the client, it tries to make calls to the default module port (localhost: 8080). Everything works fine on the remote GAE instance. What could be the reason or a workaround for this?

The code:

function init() {
  var loadCallback = function () {
    gapi.client.adminapi.mymethod(12345).then(alert(Woohoo!));
  };

  var apiRoot = '//' + window.location.host + '/_ah/api';
  gapi.client.load('adminapi', 'v1', loadCallback, apiRoot);
}
+4
source share
1 answer

, , , GAE, : https://code.google.com/p/google-api-javascript-client/issues/detail?id=147

  • : 8090/_ah/api/discovery/v1/apis/adminapi/v1/rest
  • JSON
  • baseUrl rootUrl, (8090 )
  • JSON gapi.client.load API

: @Api Java:   root = "http://localhost:8090/_ah/api",   backendRoot = "http://localhost:8090/_ah/spi",

: , URL-, , .

+2

Source: https://habr.com/ru/post/1568411/


All Articles