Skip to content

Commit ae666f1

Browse files
committed
resolving merge conflicts
inputting pusher trigger
2 parents eeda180 + 499c176 commit ae666f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+9883
-9657
lines changed

.env.sample

+5-10
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,26 @@ DB_PASSWORD=123456
44
DB_HOST=localhost || (127.0.0.1)
55
DB_PORT=5432
66
DB_DIALECT=postgres
7+
PORT=server_port || (5000)
78

89
GEN_SALT_ROUND
910
JWT_SECRET=
1011

11-
1212
FACEBOOK_CLIENT_ID
1313
FACEBOOK_CLIENT_SECRET
1414
FACEBOOK_CALLBACK_URL
1515

16-
EMAIL_ADD:
17-
EMAIL_PASS:
18-
1916
GOOGLE_CONSUMER_KEY
2017
GOOGLE_CONSUMER_SECRET
2118
GOOGLE_CALLBACK_URL
2219

23-
24-
25-
PORT=server_port || (5000)
26-
2720
JWT_EMAIL_SECRET
2821
EMAIL_ADD
2922
EMAIL_PASS
3023

3124
SENDGRID_API
3225

33-
SENDGRID_API_KEY
34-
26+
PUSHER_APP_ID
27+
PUSHER_APP_KEY
28+
PUSHER_APP_SECRET
29+
PUSHER_APP_CLUSTER

index.html

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Testing Approved Travel Request Notification</title>
5+
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
6+
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
7+
</head>
8+
<body>
9+
<h1>Testing Approved Travel Request Notification</h1>
10+
<h3>Updated some info...</h3>
11+
<script>
12+
const pusher = new Pusher('89356d2fe3911f22e19f', { cluster: 'eu' });
13+
14+
pusher.connection.bind('connected', () => {
15+
axios.defaults.headers.common['X-Socket-Id'] =
16+
pusher.connection.socket_id;
17+
});
18+
19+
Notification.requestPermission();
20+
pusher
21+
.subscribe('notifications')
22+
.bind('new-travel-6749460', (notify) => {
23+
const notification = new Notification(notify.title);
24+
notification.onclick = function(event) {
25+
window.location.href = `http://localhost:3000/api/v1/notification/${notify.id}`;
26+
event.preventDefault();
27+
notification.close();
28+
};
29+
});
30+
</script>
31+
</body>
32+
</html>

0 commit comments

Comments
 (0)