Skip to content

Commit

Permalink
make GOOGLE_APPLICATION_CREDENTIALS + GCLOUD_PROJECT optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Ran Hassid committed Apr 20, 2017
1 parent 2a8e9b9 commit f98a0f7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ const namePrefix = 'parse-server';

let emitter = new events.EventEmitter();

if (!process.env.GOOGLE_APPLICATION_CREDENTIALS) {
throw 'set GOOGLE_APPLICATION_CREDENTIALS variable (see https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.8.0/guides/authentication)';
}
// if (!process.env.GOOGLE_APPLICATION_CREDENTIALS) {
// throw 'set GOOGLE_APPLICATION_CREDENTIALS variable (see https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.8.0/guides/authentication)';
// }

// if (!process.env.GCLOUD_PROJECT) {
// throw 'set GCLOUD_PROJECT variable (see https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.8.0/guides/authentication)';
// }

if (!process.env.GCLOUD_PROJECT) {
throw 'set GCLOUD_PROJECT variable (see https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.8.0/guides/authentication)';
}

/**
* In order to use gcp pub/sub module we must provide 2 env. variables
* GCP_PROJECT_ID - the project id on GCP
* GCP_KEYFILE_PATH - path where the google service account key is located
*/
const pubsubClient = PubSub();

class Publisher {
Expand Down

0 comments on commit f98a0f7

Please sign in to comment.