-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (44 loc) · 1.5 KB
/
Copy pathindex.html
File metadata and controls
51 lines (44 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>Simple Socket Example</title>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-app.js";
import { getDatabase, ref, set } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-database.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/10.12.2/firebase-analytics.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyD7pM_SPRCiWNtrD4lZrpGmt6WWtG0c77Q",
databaseURL: "https://pgc-db-default-rtdb.firebaseio.com/",
authDomain: "pgc-db.firebaseapp.com",
projectId: "pgc-db",
storageBucket: "pgc-db.appspot.com",
messagingSenderId: "297418588201",
appId: "1:297418588201:web:1fb0bbd85902024ac49c38",
measurementId: "G-JDPZHN0EK5"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
let db = getDatabase(app);
let save_user = (alias, phone) => {
set(ref(db, 'users/' + alias), {
alias: alias,
phone: phone
});
}
save_user("CSC dudh", "123-456-7890")
</script>
</head>
<body>
<div>
<h1> Hello World </h1>
</div>
<div>
<p id="data"></p>
</div>
</body>
</html>