Last active
March 27, 2019 14:01
-
-
Save vonvick/60448d474db7c29f81417ee9bf181b31 to your computer and use it in GitHub Desktop.
Usage of middleware in route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
hasAdminRole, | |
decodeFirebaseIdToken, | |
isAuthorized | |
} from '../controllers/middleware/auth.middleware'; | |
const UserRoute = (router) => { | |
// Get all users | |
router.route('/users') | |
.get( | |
decodeFirebaseIdToken, | |
isAuthorized, | |
hasAdminRole, | |
UserController.getAllUsers | |
) | |
} | |
export default UserRoute; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment