-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase.js
22 lines (18 loc) · 850 Bytes
/
firebase.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// firebase.js
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js";
import { getDatabase, ref, push, onValue, remove } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-database.js";
const firebaseConfig = {
apiKey: "AIzaSyC72WABeQ2e117WwxS7BAs_L1A2cIo0u0Y",
authDomain: "messagingapp-9bac7.firebaseapp.com",
databaseURL: "https://messagingapp-9bac7-default-rtdb.firebaseio.com/",
projectId: "messagingapp-9bac7",
storageBucket: "messagingapp-9bac7.appspot.com",
messagingSenderId: "369463204028",
appId: "1:369463204028:web:a932d813be7ac41f5b98b9"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getDatabase(app);
const messagesRef = ref(db, "messages");
// Export Firebase functions
export { db, messagesRef, ref, push, onValue, remove };