Dexter
Dexter

Reputation: 1750

Run appengine endpoints on non-default module

I was trying to run app engine endpoints on a non-default module, but the generated JAR's dont point to the correct module.

My module name is :

<module>business-module</module>

I generate the JAR's using :

business-module:appengineEndpointsInstallClientLibs

When I open the resulting jars I see :

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/";

But technically it should have been :

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/";

I can run the api fine from the api explorer by opening :

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

EDIT

There is a related issue on the bug tracker

Upvotes: 1

Views: 137

Answers (1)

Dexter
Dexter

Reputation: 1750

Alright, got it working. Basically I set the rootURL to point to the correct module while building the Api :

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();

Upvotes: 1

Related Questions