Last active
February 13, 2019 13:39
-
-
Save ozanmuyes/78d7a09f738196ab5f8155c5c2cd1444 to your computer and use it in GitHub Desktop.
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
posts.scope('Post', '/:postId', compose([postMiddleware1, postMiddleware2, (post) => { | |
// get the 'postId' via `ctx.params` | |
post.get('ViewPost', '/', PostsController.view); | |
post.scope('Comments', '/comments', compose([postCommentMiddleware1, postCommentMiddleware2, (comments) => { | |
comments.get('Index', '/', compose([postCommentIndexMW, CommentsController.index])); | |
// also get the 'commentId' via `ctx.params` | |
comments.get('View', '/:commentId', CommentsController.view); | |
}])); | |
}])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment