Nice
All checks were successful
Deploy Encrypted Todo App / build-and-push (push) Successful in 4m16s
All checks were successful
Deploy Encrypted Todo App / build-and-push (push) Successful in 4m16s
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js",
|
"start": "node server.js",
|
||||||
|
"start:prod": "NODE_ENV=production node server.js",
|
||||||
"dev": "node server.js",
|
"dev": "node server.js",
|
||||||
"docker:build": "docker build -t encrypted-todo .",
|
"docker:build": "docker build -t encrypted-todo .",
|
||||||
"docker:run": "docker run -p 3000:3000 encrypted-todo",
|
"docker:run": "docker run -p 3000:3000 encrypted-todo",
|
||||||
|
@ -75,8 +75,10 @@
|
|||||||
|
|
||||||
function connectWebSocket() {
|
function connectWebSocket() {
|
||||||
if (!currentUser) return;
|
if (!currentUser) return;
|
||||||
|
const protocol =
|
||||||
|
window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||||
ws = new WebSocket(
|
ws = new WebSocket(
|
||||||
`ws://${window.location.host}?userId=${currentUser}`,
|
`${protocol}//${window.location.host}?userId=${currentUser}`,
|
||||||
);
|
);
|
||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
const msg = JSON.parse(event.data);
|
const msg = JSON.parse(event.data);
|
||||||
|
Reference in New Issue
Block a user