I have a controller (articles).
It performs routes: /articles, /articles/:id and this is it.
I need also the following routes - /articles/creator/:creatorId, /articles/:id/like, /articles/:id/unlike, /articles/:id/comment and so on.
Whether I need static path or action it is nested and its not working.
Partial solution for me - Controller (articles), Controller (articles/creator), Controller (articles/like), Controller (articles/unlike).
But this is a dumb solution and the concept of paths and actions is lost.
Is there an elegant solution to fix this? And how to achieve this in best way?
The code:
@Controller('articles')
class ArticlesController{
@Get(':articleId')
getById(@Param('articleId') articleId){}
@Post(':articleId/like)
like(@Param('articleId') articleId){}
@Get('creator/:creatorId')
getByCreator(@Param('creatorId') creatorId:string){}
}