-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (33 loc) · 994 Bytes
/
index.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
<html>
<head>
<title>hoi</title>
<meta charset="utf-8">
<script src="https://www.gstatic.com/firebasejs/4.3.0/firebase.js"></script>
<script src="/_compile/src/Main.elm"></script>
</head>
<body>
<script>
const app = Elm.Main.fullscreen();
// Initialize Firebase
const config = {
apiKey: "AIzaSyCzryU9q9d5KyJ91lMoB5fHqI6A0iob83E",
authDomain: "elmmeetup-f6d7b.firebaseapp.com",
databaseURL: "https://elmmeetup-f6d7b.firebaseio.com",
projectId: "elmmeetup-f6d7b",
storageBucket: "elmmeetup-f6d7b.appspot.com",
messagingSenderId: "417322017785"
};
firebase.initializeApp(config);
let ref = firebase.database().ref('global');
app.ports.persistModel.subscribe((model) => {
console.log(model)
ref.set(model);
});
ref.on('value', (snapshot) => {
let a = snapshot.val();
console.log(a);
app.ports.updateModel.send(a);
});
</script>
</body>
</html>