Update server.js
Browse files
server.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
| 1 |
-
const
|
| 2 |
const fs = require('fs');
|
| 3 |
const path = require('path');
|
| 4 |
const { WebSocketServer, WebSocket } = require('ws');
|
| 5 |
const { v4: uuidv4 } = require('uuid');
|
| 6 |
|
| 7 |
-
// βββ TLS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 8 |
-
const serverOptions = {
|
| 9 |
-
cert: fs.readFileSync('cert.pem'),
|
| 10 |
-
key: fs.readFileSync('key.pem'),
|
| 11 |
-
};
|
| 12 |
-
|
| 13 |
// βββ In-Memory State ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 14 |
// sounds[id] = { id, name, data } (data = base64 string)
|
| 15 |
// notifications[id] = { id, name, heading, body, hyperlink, displayed, soundId }
|
|
|
|
| 1 |
+
const http = require('http');
|
| 2 |
const fs = require('fs');
|
| 3 |
const path = require('path');
|
| 4 |
const { WebSocketServer, WebSocket } = require('ws');
|
| 5 |
const { v4: uuidv4 } = require('uuid');
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
// βββ In-Memory State ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 8 |
// sounds[id] = { id, name, data } (data = base64 string)
|
| 9 |
// notifications[id] = { id, name, heading, body, hyperlink, displayed, soundId }
|