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
7bd4eef0
Commit
7bd4eef0
authored
Jan 13, 2021
by
Choi Ga Young
Browse files
xxxxxx
parent
c4848cf1
Changes
4
Show whitespace changes
Inline
Side-by-side
client/src/Pages/LogInPage.js
View file @
7bd4eef0
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
Button
,
Form
,
Container
,
Navbar
}
from
'
react-bootstrap
'
;
import
{
Button
,
Form
,
Container
,
Navbar
}
from
'
react-bootstrap
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
Menu
from
'
../Components/Menu
'
;
function
LogIn
()
{
function
LogIn
()
{
const
[
validated
,
setValidated
]
=
useState
(
false
);
const
[
validated
,
setValidated
]
=
useState
(
false
);
...
@@ -18,7 +17,9 @@ function LogIn() {
...
@@ -18,7 +17,9 @@ function LogIn() {
return
(
return
(
<>
<>
<
Menu
/>
<
Navbar
bg
=
"
dark
"
variant
=
"
dark
"
>
<
Navbar
.
Brand
>
YDK
Messenger
<
/Navbar.Brand
>
<
/Navbar
>
<
Form
noValidate
validated
=
{
validated
}
onSubmit
=
{
handleSubmit
}
>
<
Form
noValidate
validated
=
{
validated
}
onSubmit
=
{
handleSubmit
}
>
<
Container
className
=
"
d-flex justify-content-center
"
>
<
Container
className
=
"
d-flex justify-content-center
"
>
<
div
className
=
"
mt-5 p-5 shadow w-75
"
>
<
div
className
=
"
mt-5 p-5 shadow w-75
"
>
...
...
client/src/Pages/SignUpPage.js
View file @
7bd4eef0
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
Button
,
Form
,
Container
,
Navbar
}
from
'
react-bootstrap
'
;
import
{
Button
,
Form
,
Container
,
Navbar
}
from
'
react-bootstrap
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
Menu
from
'
../Components/Menu
'
;
function
SingUp
()
{
function
SingUp
()
{
const
[
validated
,
setValidated
]
=
useState
(
false
);
const
[
validated
,
setValidated
]
=
useState
(
false
);
...
@@ -18,7 +18,9 @@ function SingUp() {
...
@@ -18,7 +18,9 @@ function SingUp() {
return
(
return
(
<>
<>
<
Menu
/>
<
Navbar
bg
=
"
dark
"
variant
=
"
dark
"
>
<
Navbar
.
Brand
>
YDK
Messenger
<
/Navbar.Brand
>
<
/Navbar
>
<
div
>
<
div
>
<
Form
noValidate
validated
=
{
validated
}
onSubmit
=
{
handleSubmit
}
>
<
Form
noValidate
validated
=
{
validated
}
onSubmit
=
{
handleSubmit
}
>
...
...
server/models/Chat.js
0 → 100644
View file @
7bd4eef0
import
mongoose
from
'
mongoose
'
const
{
String
}
=
mongoose
.
Schema
.
Types
const
ChatSchema
=
new
mongoose
.
Schema
({
room
:
{
type
:
ObjectId
,
required
:
true
,
ref
:
'
Room
'
,
},
nickname
:
{
type
:
String
,
required
:
true
,
ref
:
'
USer
'
,
},
chat
:
String
,
},{
timestamps
:
true
})
export
default
mongoose
.
models
.
Chat
||
mongoose
.
model
(
'
Chat
'
,
ChatSchema
)
//chat라는 이름이 있으면 앞을 return하고 없으면 뒤를 실행함
\ No newline at end of file
server/routes/user.routes.js
View file @
7bd4eef0
...
@@ -4,7 +4,7 @@ import userCtrl from '../controllers/user.controller.js'
...
@@ -4,7 +4,7 @@ import userCtrl from '../controllers/user.controller.js'
const
router
=
express
.
Router
()
const
router
=
express
.
Router
()
//router의 역할 : './주소'부분을 처리하는 역할함.
//router의 역할 : './주소'부분을 처리하는 역할함.
router
.
route
(
'
/
api/users/
signup
'
)
router
.
route
(
'
/signup
'
)
.
post
(
userCtrl
.
signup
)
.
post
(
userCtrl
.
signup
)
.
get
(
userCtrl
.
hello
)
.
get
(
userCtrl
.
hello
)
...
...
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