Skip to content

Commit 3ae7250

Browse files
committed
Use appId instead of full root URL
1 parent 7fec462 commit 3ae7250

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

google-client-api.html

Lines changed: 8 additions & 6 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 root"
58+
attributes="name version appId"
5959
extends="google-client-api"
6060
on-api-load="{{doneLoadingClient}}">
6161
<script>
@@ -103,10 +103,8 @@
103103
version: '',
104104

105105
/**
106-
* Root URL for loading a Google Cloud Endpoints API.
107-
* A valid root URL looks like this:
108-
* 'https://your_app_id.appspot.com/_ah/api'
109-
* @attribute root
106+
* App Engine application ID for loading a Google Cloud Endpoints API.
107+
* @attribute appId
110108
* @type string
111109
*/
112110

@@ -195,10 +193,14 @@
195193
this.fireError();
196194
// Otherwise, looks like we're loading a new API.
197195
} else {
196+
var root;
197+
if (this.appId) {
198+
root = 'https://' + this.appId + '.appspot.com/_ah/api';
199+
}
198200
statuses_[this.name] = 'loading';
199201
loaders_[this.name] = this;
200202
gapi.client.load(this.name, this.version,
201-
this.handleLoadResponse.bind(this), this.root);
203+
this.handleLoadResponse.bind(this), root);
202204
}
203205
}
204206
}

0 commit comments

Comments
 (0)