-
Notifications
You must be signed in to change notification settings - Fork 50
/
mutfak.html
41 lines (39 loc) · 1.4 KB
/
mutfak.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.2.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.1/firebase-firestore.js"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: 'AIzaSyAvv7f63mnrP_YOZANOVWl5sJXNwwyWO4I',
authDomain: 'mutfak-dev.firebaseapp.com',
databaseURL: 'https://mutfak-dev.firebaseio.com',
projectId: 'mutfak-dev',
storageBucket: 'mutfak-dev.appspot.com',
messagingSenderId: '674571176433',
appId: '1:674571176433:web:a080b235dcc90d9a',
}
// Initialize Firebase
firebase.initializeApp(firebaseConfig)
const db = firebase.firestore()
db.collection('post')
.where('procced', '==', true)
.onSnapshot((snapshot) => {
snapshot.docChanges().forEach(async (change) => {
if (change.type === 'added') {
const data = change.doc.data()
console.log(data)
}
})
})
</script>
</body>
</html>