Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
messenger
Commits
7b2efa8f
Commit
7b2efa8f
authored
Jan 26, 2021
by
Soo Hyun Kim
Browse files
0126머지후
parents
650999ad
108b1b94
Changes
23
Show whitespace changes
Inline
Side-by-side
server/routes/user.routes.js
View file @
7b2efa8f
...
...
@@ -7,6 +7,10 @@ const router = express.Router()
router
.
route
(
'
/users/signup
'
)
.
post
(
userCtrl
.
signup
)
router
.
route
(
'
/users/check
'
)
.
get
(
userCtrl
.
checkUser
)
router
.
route
(
`/users/:userId`
)
.
get
(
userCtrl
.
getProfile
)
.
put
(
userCtrl
.
profileUpload
,
userCtrl
.
update
)
...
...
server/server.js
View file @
7b2efa8f
...
...
@@ -34,12 +34,6 @@ io.on("connection", (socket) => { // 기본 연결
socket
.
leave
(
roomInfo
);
//클라이언트에서 data에 적힌 room정보를 브로드캐스팅 받지 않는다.
});
socket
.
on
(
'
newUser
'
,
(
data
)
=>
{
console
.
log
(
'
newUser
'
,
data
)
let
userInfo
=
data
.
userInfo
;
io
.
to
(
data
.
rmIf
).
emit
(
'
sendUser
'
,
userInfo
)
})
socket
.
on
(
'
chat
'
,
async
(
data
)
=>
{
console
.
log
(
'
roomname확인
'
,
data
)
const
room
=
await
Room
.
findOne
({
roomId
:
data
.
roomInfo
})
...
...
@@ -48,7 +42,8 @@ io.on("connection", (socket) => { // 기본 연결
const
chat
=
await
new
Chat
({
room
:
room
.
_id
,
username
:
data
.
sendInfo
.
sender
,
message
:
data
.
sendInfo
.
msg
message
:
data
.
sendInfo
.
msg
,
profileimg
:
data
.
sendInfo
.
img
}).
save
()
console
.
log
(
'
resChat확인
'
,
chat
)
...
...
uploads/19877e6cdeb6d21139ee57df54bc0ddd
0 → 100644
View file @
7b2efa8f
File added
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment