Created
March 29, 2021 13:22
-
-
Save YousraBD/1b8a13ae4614ac24bb2311f5b7803dc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/firebase.js | |
import firebase from 'firebase/app'; | |
import 'firebase/auth'; | |
import 'firebase/firestore'; | |
// TODO: Use a configuration object | |
firebaseApp.initializeApp({ | |
projectId: '', | |
appId: '', | |
databaseURL: '', | |
storageBucket: '', | |
locationId: '', | |
apiKey: '', | |
authDomain: '', | |
messagingSenderId: '', | |
}); | |
const db = firebase.firestore(); | |
const auth = firebase.auth; | |
// eslint-disable-next-line no-restricted-globals | |
if (location.hostname === 'localhost') { | |
db.useEmulator('localhost', 8080); | |
auth().useEmulator('http://localhost:9099/', { disableWarnings: true }); | |
} | |
export default firebase; | |
export { db, auth }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment