java - 在非默认模块上运行 appengine 端点

标签 java google-app-engine google-cloud-endpoints google-cloud-platform

我尝试在非默认模块上运行应用引擎端点,但生成的 JAR 未指向正确的模块。

我的模块名称是:

<module>business-module</module>

我使用以下方式生成 JAR:

business-module:appengineEndpointsInstallClientLibs

当我打开生成的 jar 时,我看到:

public static final String DEFAULT_ROOT_URL = "https://project-id.appspot.com/_ah/api/";
public static final String DEFAULT_SERVICE_PATH = "blahApi/v1/";
public static final String DEFAULT_BASE_URL = "https://project-id.appspot.com/_ah/api/blahApi/v1/";

但从技术上讲它应该是:

public static final String DEFAULT_ROOT_URL = "https://1-dot-business-module-dot-project-id.appspot.com/_ah/api/";
public static final String DEFAULT_SERVICE_PATH = "blahApi/v1/";
public static final String DEFAULT_BASE_URL = "https://1-dot-business-module-dot-project-id.appspot.com/_ah/api/blahApi/v1/";

我可以通过打开 api explorer 来正常运行 api:

https://apis-explorer.appspot.com/apis-explorer/?base=https://1-dot-business-module-dot-project-id.appspot.com/_ah/api#p

编辑

bug tracker 上存在相关问题

最佳答案

好的,已经开始工作了。 基本上,我在构建 Api 时将 rootURL 设置为指向正确的模块:

final BlahApi businessApi = CloudEndPointsUtils.updateBuilder(new BlahApi.Builder(transport, factory, credential)
.setRootUrl("https://1-dot-business-module-dot-project-id.appspot.com/_ah/api/")).build();

关于java - 在非默认模块上运行 appengine 端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35294439/

相关文章:

java - 适用于任何 Java 项目的代码混淆器

google-app-engine - 安装appengine sdk后Golang未定义google.JWTAccessTokenSourceFromJSON

android - 如何通过 Android 应用程序访问应用程序引擎数据存储区?

java - 迭代当前月份以获取所有事件

java - 无法使用 selenium 单击 <label for ="chk"> 标签内的复选框

google-app-engine - jsessionID 在运行 GAE devserver 时附加到 url

javascript - Google App Engine channel 代码在生产中失败,javascript "Cannot read property ' removeEventListener' of undefined "error

java - 31 个客户端之一的 Appengine Endpoints Android 客户端中的 SSLProtocolException

java - Google Cloud Endpoints 是否用于创建 RESTful API?

java - 如何在 spring mvc 中用 thymeleaf 填充一个简单的表