Skip to content

Commit

Permalink
docs: redirect EMULATOR_HOST users to apiEndpoint (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaffeeullah authored Mar 30, 2021
1 parent 5792a3c commit bd9ef18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ export class Storage extends Service {
let apiEndpoint = 'https://storage.googleapis.com';
let customEndpoint = false;

// Note: EMULATOR_HOST is an experimental configuration variable. Use apiEndpoint instead.
const EMULATOR_HOST = process.env.STORAGE_EMULATOR_HOST;
if (typeof EMULATOR_HOST === 'string') {
apiEndpoint = Storage.sanitizeEndpoint(EMULATOR_HOST);
Expand All @@ -409,6 +410,7 @@ export class Storage extends Service {

options = Object.assign({}, options, {apiEndpoint});

// Note: EMULATOR_HOST is an experimental configuration variable. Use apiEndpoint instead.
const baseUrl = EMULATOR_HOST || `${options.apiEndpoint}/storage/v1`;

const config = {
Expand Down
1 change: 1 addition & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ describe('Storage', () => {
});

describe('STORAGE_EMULATOR_HOST', () => {
// Note: EMULATOR_HOST is an experimental configuration variable. Use apiEndpoint instead.
const EMULATOR_HOST = 'https://internal.benchmark.com/path';
before(() => {
process.env.STORAGE_EMULATOR_HOST = EMULATOR_HOST;
Expand Down

0 comments on commit bd9ef18

Please sign in to comment.