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
aded789a
Commit
aded789a
authored
Jan 13, 2021
by
JeongYeonwoo
Browse files
socket연결
parent
216a1640
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/src/Components/Chat.js
View file @
aded789a
...
@@ -14,6 +14,7 @@ function Chat(props) {
...
@@ -14,6 +14,7 @@ function Chat(props) {
}
}
return
(
return
(
<
div
className
=
"
chat
"
id
=
"
chat
"
style
=
{{
border
:
"
2px solid
"
,
height
:
"
300%
"
,
margin
:
"
1%
"
,
borderColor
:
"
#BDBDBD
"
}}
>
<
div
className
=
"
chat
"
id
=
"
chat
"
style
=
{{
border
:
"
2px solid
"
,
height
:
"
300%
"
,
margin
:
"
1%
"
,
borderColor
:
"
#BDBDBD
"
}}
>
<
Button
variant
=
"
light
"
onClick
=
{
props
.
handleChatc
}
>
{
`<`
}
<
/Button
>
<
Button
variant
=
"
light
"
onClick
=
{
props
.
handleChatc
}
>
{
`<`
}
<
/Button
>
<
h2
>
현재
{
props
.
roomName
}
입니다
.
<
/h2
>
<
h2
>
현재
{
props
.
roomName
}
입니다
.
<
/h2
>
...
...
client/src/Pages/HomePage.js
View file @
aded789a
...
@@ -59,9 +59,10 @@ function Home() {
...
@@ -59,9 +59,10 @@ function Home() {
console
.
log
(
'
msg
'
,
msg
)
console
.
log
(
'
msg
'
,
msg
)
console
.
log
(
'
inner :
'
,
inner
)
console
.
log
(
'
inner :
'
,
inner
)
setChat
([...
chatmsg
,
msg
])
setChatmsg
([...
chatmsg
,
msg
])
console
.
log
(
'
useeffect2
'
,
chatmsg
)
})
})
console
.
log
(
'
useeffect2
'
,
chat
)
console
.
log
(
'
useeffect2
'
,
chat
msg
)
},
[
chatmsg
])
},
[
chatmsg
])
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
...
...
server/server.js
View file @
aded789a
...
@@ -60,7 +60,7 @@ app.get('/', (req, res) => {
...
@@ -60,7 +60,7 @@ app.get('/', (req, res) => {
res
.
send
(
'
Hello World. 안녕하세요
'
)
res
.
send
(
'
Hello World. 안녕하세요
'
)
})
})
app
.
listen
(
3030
,
()
=>
{
server
.
listen
(
3030
,
()
=>
{
console
.
log
(
'
Listening on port 3030
'
)
console
.
log
(
'
Listening on port 3030
'
)
})
})
...
...
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