From 819efbf282044fcc75ddd71132813de3c7a301ce Mon Sep 17 00:00:00 2001 From: Abe Haskins Date: Thu, 29 Nov 2018 17:34:00 -0800 Subject: [PATCH] Changes default makeObjectMetadata bucket to inherit from FIREBASE_CONFIG #19 (#33) --- src/providers/storage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/providers/storage.ts b/src/providers/storage.ts index f82a47e..e0d521e 100644 --- a/src/providers/storage.ts +++ b/src/providers/storage.ts @@ -27,10 +27,11 @@ export function makeObjectMetadata( /** Fields of ObjectMetadata that you'd like to specify. */ fields: { [key: string]: string }, ): storage.ObjectMetadata { + const configBucket = JSON.parse(process.env.FIREBASE_CONFIG || '{}').storageBucket; const template = { kind: 'storage#object', id: '', - bucket: '', + bucket: configBucket || '', timeCreated: '', updated: '', storageClass: 'STANDARD',