我正在开发一个带有几个模块的Google App Engine应用程序。后端API使用Google Cloud Endpoints。当我在本地运行GAE服务器时,即使我在加载客户端后从我的管理模块(localhost:9090)加载API,它也会尝试调用默认模块端口(localhost:8080)。在远程GAE实例上,一切正常。可能是什么原因或解决方法呢?如何在本地Google App Engine的非默认模块上访问Google Cloud Endpoints?
的代码是:
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);
}