Skip to content

Commit e56ab48

Browse files
committed
Updated the config with service account credentials content.
1 parent 5dd8665 commit e56ab48

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

app/js/firebaseConfig.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ let config = {
99
databaseURL: process.env.FIREBASE_DATABASE_URL,
1010
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
1111
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
12-
keyJsonFilePath: process.env.FIREBASE_SERVICE_ACCOUNT_JSON_PATH
12+
keyJsonFilePath: process.env.FIREBASE_SERVICE_ACCOUNT_JSON_PATH,
13+
keyJsonContent: process.env.FIREBASE_SERVICE_ACCOUNT_JSON_CONTENT || require(process.env.FIREBASE_SERVICE_ACCOUNT_JSON_PATH)
1314
};
1415

1516
module.exports = config;

app/js/memeng.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ var MemeNG = function (firebase, config) {
2727
this.firebase = firebase;
2828
this.database = firebase.database();
2929
this.auth = firebase.auth();
30-
3130
if(firebase.storage){
3231
this.storage = firebase.storage();
3332
}
3433
else{
3534
var gcloud = require('gcloud')({
3635
projectId: config.projectId,
37-
keyFilename: config.keyJsonFilePath
36+
// keyFilename: config.keyJsonFilePath
37+
credentials: config.keyJsonContent
3838
});
3939

4040
var gcs = gcloud.storage();

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ require('dotenv').config({silent: true});
99

1010
process.env['PROJECT_ROOT'] = __dirname;
1111
process.env['FIREBASE_SERVICE_ACCOUNT_JSON_PATH'] = __dirname + process.env.FIREBASE_SERVICE_ACCOUNT_JSON_RELATIVE_PATH;
12+
// process.env['FIREBASE_SERVICE_ACCOUNT_JSON_CONTENT'] = require(process.env.FIREBASE_SERVICE_ACCOUNT_JSON_PATH);
1213

14+
// console.log(require(process.env.FIREBASE_SERVICE_ACCOUNT_JSON_PATH).type);
1315
// Start the app
1416
require('./app/app');

0 commit comments

Comments
 (0)