-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
21 lines (16 loc) · 798 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js";
import { getDatabase, ref, push } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-database.js";
const appSettings = {
databaseURL: "https://valentinee-1-default-rtdb.firebaseio.com/",
};
// Initialize Firebase
const app = initializeApp(appSettings);
const database = getDatabase(app);
const UsersInDB = ref(database, 'user');
const fpNameStored = localStorage.getItem("fpName");
const spNameStored = localStorage.getItem("spName");
const storageQuote = localStorage.getItem("chosenQuote");
const datas = { firstUser: fpNameStored, secondUser: spNameStored, quote: storageQuote };
document.addEventListener("DOMContentLoaded", function() {
push(UsersInDB,datas);
})