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
survey
Commits
f5f8f2b1
Commit
f5f8f2b1
authored
Jul 08, 2022
by
Yoon, Daeki
😅
Browse files
역할 라우트 기능 추가
parent
6050aa37
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/routes/index.ts
View file @
f5f8f2b1
import
express
from
"
express
"
;
import
userRouter
from
"
./user.route
"
;
import
authRouter
from
"
./auth.route
"
;
import
roleRouter
from
"
./role.route
"
;
const
router
=
express
.
Router
();
router
.
use
(
"
/users
"
,
userRouter
);
router
.
use
(
"
/auth
"
,
authRouter
);
router
.
use
(
"
/roles
"
,
roleRouter
);
router
.
use
(
"
/users
"
,
userRouter
);
export
default
router
;
src/routes/role.route.ts
0 → 100644
View file @
f5f8f2b1
import
express
from
"
express
"
;
import
{
authCtrl
,
roleCtrl
}
from
"
../controllers
"
;
const
router
=
express
.
Router
();
router
.
all
(
"
/
"
,
authCtrl
.
requireLogin
);
router
.
route
(
"
/
"
).
get
(
authCtrl
.
hasRole
(
"
admin
"
),
roleCtrl
.
getRoles
);
export
default
router
;
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