Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
feat: switch to dns endpoint (options.apiEndpoint is available if tim…
Browse files Browse the repository at this point in the history
…e is needed to migrate) (#283)
  • Loading branch information
bcoe authored and JustinBeckwith committed Jul 11, 2019
1 parent 8e06c7a commit 5c180b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions linkinator.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recurse": true,
"skip": [
"https://codecov.io/gh/googleapis/",
"www.googleapis.com"
"https://codecov.io/gh/googleapis/"
]
}
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type CreateZoneResponse = [Zone, Metadata];
export interface DNSOptions extends GoogleAuthOptions {
/**
* The API endpoint of the service used to make requests.
* Defaults to `www.googleapis.com`.
* Defaults to `dns.googleapis.com`.
*/
apiEndpoint?: string;
}
Expand Down Expand Up @@ -127,7 +127,7 @@ export interface DNSOptions extends GoogleAuthOptions {
class DNS extends Service {
getZonesStream: (query: GetZonesRequest) => Stream;
constructor(options: DNSOptions = {}) {
options.apiEndpoint = options.apiEndpoint || 'www.googleapis.com';
options.apiEndpoint = options.apiEndpoint || 'dns.googleapis.com';
const config = {
apiEndpoint: options.apiEndpoint,
baseUrl: `https://${options.apiEndpoint}/dns/v1`,
Expand Down
2 changes: 1 addition & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('DNS', () => {

const calledWith = dns.calledWith_[0];

const baseUrl = 'https://www.googleapis.com/dns/v1';
const baseUrl = 'https://dns.googleapis.com/dns/v1';
assert.strictEqual(calledWith.baseUrl, baseUrl);
assert.deepStrictEqual(calledWith.scopes, [
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
Expand Down

0 comments on commit 5c180b4

Please sign in to comment.