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
travel
Commits
14bcff90
Commit
14bcff90
authored
Jul 25, 2022
by
Lee Soobeom
Browse files
Merge remote-tracking branch 'origin/MK20' into develop
parents
35f41d6b
154cb55a
Changes
22
Hide whitespace changes
Inline
Side-by-side
src/routes/profile.route.ts
View file @
14bcff90
import
express
from
"
express
"
;
import
express
from
"
express
"
;
import
{
userCtrl
,
authCtrl
}
from
"
../controllers
"
;
import
{
userCtrl
,
authCtrl
,
fileInfoCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
router
router
.
route
(
"
/
"
)
.
route
(
"
/
"
)
.
get
(
authCtrl
.
requireLogin
,
userCtrl
.
getProfile
)
.
get
(
authCtrl
.
requireLogin
,
userCtrl
.
getProfile
)
.
post
(
authCtrl
.
requireLogin
,
userCtrl
.
postPicture
);
//중간에 req쪽에 fields와 files 넣는 미들웨어 추가
.
post
(
authCtrl
.
requireLogin
,
fileInfoCtrl
.
uploadFile
,
userCtrl
.
postPicture
);
//중간에 req쪽에 fields와 files 넣는 미들웨어 추가
router
.
route
(
"
/delete
"
).
post
(
authCtrl
.
requireLogin
,
userCtrl
.
deleteUser
);
router
.
route
(
"
/delete
"
).
delete
(
authCtrl
.
requireLogin
,
userCtrl
.
deleteUser
);
export
default
router
;
export
default
router
;
src/routes/user.route.ts
View file @
14bcff90
import
express
from
"
express
"
;
import
express
from
"
express
"
;
import
{
userCtrl
,
authCtrl
}
from
"
../controllers
"
;
import
{
userCtrl
,
authCtrl
,
fileInfoCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
router
router
.
route
(
"
/
"
)
.
route
(
"
/
"
)
.
get
(
authCtrl
.
requireLogin
,
userCtrl
.
getUsers
)
.
get
(
authCtrl
.
requireLogin
,
userCtrl
.
getUsers
)
.
post
(
authCtrl
.
requireLogin
,
authCtrl
.
hasRole
(
"
admin
"
),
userCtrl
.
createUser
);
.
post
(
authCtrl
.
requireLogin
,
authCtrl
.
hasRole
(
"
admin
"
),
fileInfoCtrl
.
uploadFile
,
userCtrl
.
createUser
);
export
default
router
;
export
default
router
;
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