From dbe6428087ba866fb5051a8a46b3085ff5cc5f6a Mon Sep 17 00:00:00 2001 From: Jonas dos Santos Date: Fri, 9 Dec 2022 11:34:15 +0100 Subject: [PATCH] APP | Firebase Config File - API KEY through NODE_ENV --- src/utils/firebase.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/utils/firebase.js diff --git a/src/utils/firebase.js b/src/utils/firebase.js new file mode 100644 index 0000000..48de480 --- /dev/null +++ b/src/utils/firebase.js @@ -0,0 +1,28 @@ + +import firebase from 'firebase' +import "firebase/storage"; + +export const config = { + apiKey: process.env.VUE_APP_FIREBASE_API_KEY, + authDomain: 'flowsensor-bfbed.firebaseapp.com', + databaseURL: 'https://flowsensor-bfbed.firebaseio.com', + projectId: 'flowsensor-bfbed', + storageBucket: 'flowsensor-bfbed.appspot.com', + messagingSenderId: '529363595938', + appId: "1:529363595938:web:25060447cf953e866c1dfb" +} + +let firebaseApp + +if (firebase.apps && firebase.apps.length > 0) { + firebaseApp = firebase.apps[0] +} else { + firebaseApp = firebase.initializeApp(config) +} + +export default firebaseApp + + + + +