【问题标题】:Run appengine endpoints on non-default module在非默认模块上运行 appengine 端点
【发布时间】:2016-05-19 13:54:07
【问题描述】:

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

我的模块名称是:

<module>business-module</module>

我使用以下方法生成 JAR:

business-module:appengineEndpointsInstallClientLibs

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

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有一个相关问题

【问题讨论】:

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


    【解决方案1】:

    好的,开始工作了。 基本上我在构建 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();
    

    【讨论】:

      猜你喜欢
      • 2013-03-12
      • 2014-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-01
      • 2014-09-29
      • 1970-01-01
      相关资源
      最近更新 更多