Showing
3 changed files
with
16 additions
and
6 deletions
... | @@ -18,7 +18,7 @@ io.on('connection', (socket) => { | ... | @@ -18,7 +18,7 @@ io.on('connection', (socket) => { |
18 | io.emit("chatting", { | 18 | io.emit("chatting", { |
19 | name, | 19 | name, |
20 | msg, | 20 | msg, |
21 | - time: moment.format("h:ss A") | 21 | + time: moment(new Date()).format("h:ss A") |
22 | }) | 22 | }) |
23 | }) | 23 | }) |
24 | }); | 24 | }); | ... | ... |
... | @@ -239,7 +239,8 @@ | ... | @@ -239,7 +239,8 @@ |
239 | }, | 239 | }, |
240 | "node_modules/express": { | 240 | "node_modules/express": { |
241 | "version": "4.18.1", | 241 | "version": "4.18.1", |
242 | - "license": "MIT", | 242 | + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", |
243 | + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", | ||
243 | "dependencies": { | 244 | "dependencies": { |
244 | "accepts": "~1.3.8", | 245 | "accepts": "~1.3.8", |
245 | "array-flatten": "1.1.1", | 246 | "array-flatten": "1.1.1", |
... | @@ -425,7 +426,8 @@ | ... | @@ -425,7 +426,8 @@ |
425 | }, | 426 | }, |
426 | "node_modules/moment": { | 427 | "node_modules/moment": { |
427 | "version": "2.29.3", | 428 | "version": "2.29.3", |
428 | - "license": "MIT", | 429 | + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz", |
430 | + "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==", | ||
429 | "engines": { | 431 | "engines": { |
430 | "node": "*" | 432 | "node": "*" |
431 | } | 433 | } |
... | @@ -599,7 +601,8 @@ | ... | @@ -599,7 +601,8 @@ |
599 | }, | 601 | }, |
600 | "node_modules/socket.io": { | 602 | "node_modules/socket.io": { |
601 | "version": "4.5.1", | 603 | "version": "4.5.1", |
602 | - "license": "MIT", | 604 | + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz", |
605 | + "integrity": "sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ==", | ||
603 | "dependencies": { | 606 | "dependencies": { |
604 | "accepts": "~1.3.4", | 607 | "accepts": "~1.3.4", |
605 | "base64id": "~2.0.0", | 608 | "base64id": "~2.0.0", |
... | @@ -873,6 +876,8 @@ | ... | @@ -873,6 +876,8 @@ |
873 | }, | 876 | }, |
874 | "express": { | 877 | "express": { |
875 | "version": "4.18.1", | 878 | "version": "4.18.1", |
879 | + "resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz", | ||
880 | + "integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==", | ||
876 | "requires": { | 881 | "requires": { |
877 | "accepts": "~1.3.8", | 882 | "accepts": "~1.3.8", |
878 | "array-flatten": "1.1.1", | 883 | "array-flatten": "1.1.1", |
... | @@ -989,7 +994,9 @@ | ... | @@ -989,7 +994,9 @@ |
989 | } | 994 | } |
990 | }, | 995 | }, |
991 | "moment": { | 996 | "moment": { |
992 | - "version": "2.29.3" | 997 | + "version": "2.29.3", |
998 | + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz", | ||
999 | + "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==" | ||
993 | }, | 1000 | }, |
994 | "ms": { | 1001 | "ms": { |
995 | "version": "2.0.0" | 1002 | "version": "2.0.0" |
... | @@ -1091,6 +1098,8 @@ | ... | @@ -1091,6 +1098,8 @@ |
1091 | }, | 1098 | }, |
1092 | "socket.io": { | 1099 | "socket.io": { |
1093 | "version": "4.5.1", | 1100 | "version": "4.5.1", |
1101 | + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz", | ||
1102 | + "integrity": "sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ==", | ||
1094 | "requires": { | 1103 | "requires": { |
1095 | "accepts": "~1.3.4", | 1104 | "accepts": "~1.3.4", |
1096 | "base64id": "~2.0.0", | 1105 | "base64id": "~2.0.0", | ... | ... |
1 | "use strict" | 1 | "use strict" |
2 | -const socket = io.connect("http://localhost:3000/", {transports:['websocket']}); | 2 | +//const socket = io.connect("http://localhost:3000/", {transports:['websocket']}); |
3 | +const socket = io(); | ||
3 | 4 | ||
4 | const nickname = document.querySelector("#nickname") | 5 | const nickname = document.querySelector("#nickname") |
5 | const chatlist = document.querySelector(".chatting-list") | 6 | const chatlist = document.querySelector(".chatting-list") | ... | ... |
-
Please register or login to post a comment