Skip to content

Commit

Permalink
feat: support apiEndpoint override (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Jun 1, 2019
1 parent 261218e commit 6a5eb36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Expand Up @@ -45,6 +45,7 @@ const gapic = Object.freeze({
const gcpApiConfig = require('./spanner_grpc_config.json');

export interface SpannerOptions extends GrpcClientOptions {
apiEndpoint?: string;
servicePath?: string;
port?: number;
sslCreds?: ChannelCredentials;
Expand Down Expand Up @@ -224,7 +225,10 @@ class Spanner extends Service {
options = Object.assign({'grpc_gcp.apiConfig': gcpApiConfig}, options);

const config = ({
baseUrl: options.servicePath || gapic.v1.SpannerClient.servicePath,
baseUrl:
options.apiEndpoint ||
options.servicePath ||
gapic.v1.SpannerClient.servicePath,
protosDir: path.resolve(__dirname, '../protos'),
protoServices: {
Operations: {
Expand Down

0 comments on commit 6a5eb36

Please sign in to comment.