Polymer google-client-loader, does not care about root property

268 views Asked by At

I'm trying to get my Polymer1.0 app to work with my google cloud endpoints API but for some reason it seems that google-client-loader doesn't care what i put in for root, it always goes to content.googleapis.com to fetch the API , of course it isn't there !

code:

<google-client-loader
                id="api" name="parliament" version="v1"
                root="http://localhost:8080/_ah/api"></google-client-loader>

getting:

GET https://content.googleapis.com/discovery/v1/apis/parliament/v1/rest?fields=rootUrl%2CservicePath%2Cresources%2Cparameters%2Cmethods&pp=0 404 (OK)

tried:

  • api-root
  • apiRoot
  • root
  • api-root with app-id
  • apiRoot with app-id
  • root with app-id

doesn't work !

What's the problem ? Am I doing something wrong ?

1

There are 1 answers

0
Scarygami On BEST ANSWER

The correct attribute to use is api-root (which works, just tested).

<google-client-loader
     id="api" name="parliament" version="v1"
     api-root="http://localhost:8080/_ah/api"></google-client-loader>

You have to make sure to use the latest version of the google-apis element collection, i.e. with this dependency in your bower.json:

"google-apis": "GoogleWebComponents/google-apis#^1.0.1"