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
|
// Give the service worker access to Firebase Messaging.
// Note that you can only use Firebase Messaging here. Other Firebase libraries
// are not available in the service worker.
// Replace 10.13.2 with latest version of the Firebase JS SDK.
import { initializeApp } from "firebase/app";
import { getMessaging, onMessage } from "firebase/messaging";
// Initialize the Firebase app in the service worker by passing in
// your app's Firebase config object.
// https://firebase.google.com/docs/web/setup#config-object
const app = initializeApp({
apiKey: "AIzaSyBGAmu8jDF4YN8v7n0pddM_0ZyYyC1UnUY",
authDomain: "victoria-hall-laundryweb-cm.firebaseapp.com",
projectId: "victoria-hall-laundryweb-cm",
storageBucket: "victoria-hall-laundryweb-cm.firebasestorage.app",
messagingSenderId: "693379336541",
appId: "1:693379336541:web:6697894ff39d20e8a700b4"
});
// Retrieve an instance of Firebase Messaging so that it can handle background
// messages.
const messaging = getMessaging(app);
onMessage(messaging, (payload) => {
console.log('go fuck yourself ', payload);
});
document.cookie = "session_key=0"
const data = {
duration: 2,
block: 1,
machine: 2,
}
fetch("http://localhost:8000/start", {
credentials: "include",
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
|