Skip to content

Commit 5c82059

Browse files
committed
Merge pull request #18 from Scarygami/cloud-endpoints-support
Enable support for Google Cloud Endpoints
2 parents 206d2fa + 3ae7250 commit 5c82059

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

google-client-api.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
@homepage http://polymerlabs.github.io/google-apis
5656
-->
5757
<polymer-element name="google-api-loader"
58-
attributes="name version"
58+
attributes="name version appId"
5959
extends="google-client-api"
6060
on-api-load="{{doneLoadingClient}}">
6161
<script>
@@ -102,6 +102,12 @@
102102
*/
103103
version: '',
104104

105+
/**
106+
* App Engine application ID for loading a Google Cloud Endpoints API.
107+
* @attribute appId
108+
* @type string
109+
*/
110+
105111
// Used to fix events potentially being fired multiple times by
106112
// core-shared-lib.
107113
waiting: false,
@@ -187,10 +193,14 @@
187193
this.fireError();
188194
// Otherwise, looks like we're loading a new API.
189195
} else {
196+
var root;
197+
if (this.appId) {
198+
root = 'https://' + this.appId + '.appspot.com/_ah/api';
199+
}
190200
statuses_[this.name] = 'loading';
191201
loaders_[this.name] = this;
192202
gapi.client.load(this.name, this.version,
193-
this.handleLoadResponse.bind(this));
203+
this.handleLoadResponse.bind(this), root);
194204
}
195205
}
196206
}

0 commit comments

Comments
 (0)