GoogleApis options rootUrl is never used
Closed this issue · 6 comments
yitomok commented
Environment details
- OS:
any
- Node.js version:
^12
- npm version:
^6
googleapis-common
version:5.0.0
Steps to reproduce
const { GoogleApis } = require('googleapis');
const google = new GoogleApis({
rootUrl: 'https://googleapis-endpoint'
});
// gmail API is used for example, it should happen to others as they share createAPIRequest()
const gmail = google.gmail('v1');
// Here it is still using default https://gmail.googleapis.com
gmail.users.history.list({ userId: 'me' });
JustinBeckwith commented
Greetings! This isn't the way you set global options :) This is covered in the documentation here:
https://github.com/googleapis/google-api-nodejs-client#request-options
Does this currently work for you?
const {google} = require('googleapis');
google.options({
rootUrl: 'https://googleapis-endpoint',
});
yitomok commented
@JustinBeckwith The type definition here says it can use new
nevertheless constructor is using the same options()
here, which is also not working.
The actual cause is not where the option is set, is how it is used, please see my PR #356
JustinBeckwith commented
Heh, the code was running ahead of the docs 😆 Thanks for the pointer!
yitomok commented
@JustinBeckwith any news?
JustinBeckwith commented
nope
sofisl commented
Closing this for now as we are not looking to support global setting of rootUrl.