Last active
March 29, 2021 13:24
-
-
Save zackbraksa/aebd4ecb3e1821c7c14dbac177d8d958 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