Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jeongmin Seo
/
favorite_restaurant
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Jumi Yang
2022-06-09 14:23:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e7e15fc0c9d7f084b2e02890b557144a9dea80cc
e7e15fc0
1 parent
46edde80
Finish chat
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
chat/app/app.js
chat/app/package-lock.json
chat/app/src/js/chat.js
chat/app/app.js
View file @
e7e15fc
...
...
@@ -18,7 +18,7 @@ io.on('connection', (socket) => {
io
.
emit
(
"chatting"
,
{
name
,
msg
,
time
:
moment
.
format
(
"h:ss A"
)
time
:
moment
(
new
Date
())
.
format
(
"h:ss A"
)
})
})
});
...
...
chat/app/package-lock.json
View file @
e7e15fc
...
...
@@ -239,7 +239,8 @@
},
"node_modules/express"
:
{
"version"
:
"4.18.1"
,
"license"
:
"MIT"
,
"resolved"
:
"https://registry.npmjs.org/express/-/express-4.18.1.tgz"
,
"integrity"
:
"sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q=="
,
"dependencies"
:
{
"accepts"
:
"~1.3.8"
,
"array-flatten"
:
"1.1.1"
,
...
...
@@ -425,7 +426,8 @@
},
"node_modules/moment"
:
{
"version"
:
"2.29.3"
,
"license"
:
"MIT"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.29.3.tgz"
,
"integrity"
:
"sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
,
"engines"
:
{
"node"
:
"*"
}
...
...
@@ -599,7 +601,8 @@
},
"node_modules/socket.io"
:
{
"version"
:
"4.5.1"
,
"license"
:
"MIT"
,
"resolved"
:
"https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz"
,
"integrity"
:
"sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ=="
,
"dependencies"
:
{
"accepts"
:
"~1.3.4"
,
"base64id"
:
"~2.0.0"
,
...
...
@@ -873,6 +876,8 @@
},
"express"
:
{
"version"
:
"4.18.1"
,
"resolved"
:
"https://registry.npmjs.org/express/-/express-4.18.1.tgz"
,
"integrity"
:
"sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q=="
,
"requires"
:
{
"accepts"
:
"~1.3.8"
,
"array-flatten"
:
"1.1.1"
,
...
...
@@ -989,7 +994,9 @@
}
},
"moment"
:
{
"version"
:
"2.29.3"
"version"
:
"2.29.3"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.29.3.tgz"
,
"integrity"
:
"sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
},
"ms"
:
{
"version"
:
"2.0.0"
...
...
@@ -1091,6 +1098,8 @@
},
"socket.io"
:
{
"version"
:
"4.5.1"
,
"resolved"
:
"https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz"
,
"integrity"
:
"sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ=="
,
"requires"
:
{
"accepts"
:
"~1.3.4"
,
"base64id"
:
"~2.0.0"
,
...
...
chat/app/src/js/chat.js
View file @
e7e15fc
"use strict"
const
socket
=
io
.
connect
(
"http://localhost:3000/"
,
{
transports
:[
'websocket'
]});
//const socket = io.connect("http://localhost:3000/", {transports:['websocket']});
const
socket
=
io
();
const
nickname
=
document
.
querySelector
(
"#nickname"
)
const
chatlist
=
document
.
querySelector
(
".chatting-list"
)
...
...
Please
register
or
login
to post a comment