Nest: Concatenated routes

Created on 10 May 2018  路  3Comments  路  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[ ] Bug report
[X ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior


If you import a module inside other module, the controller's routes aren't concatenated.

Expected behavior

I mean, If a have a controller: @Controller("animals") in my module animals, and I import a module cats with @Controller("cats"), I think that cats route should be: /animals/cats

Environment

[System Information]

NodeJS Version : v10.0.0
NPM Version : 6.0.0


Nest version: 
microservices version : 5.0.0-beta.6
websockets version    : 5.0.0-beta.6
mongoose version      : 3.0.1
swagger version       : 1.2.2
testing version       : 5.0.0-beta.6
common version        : 5.0.0-beta.6
core version          : 5.0.0-beta.6

For Tooling issues:
- Node version: XX  10.0.0
- Platform:  OS Version     : Windows 7

question 馃檶

Most helpful comment

Hay @menme95

actually your question was asked some time ago but in another format, and it was along discussion you could check it out here #255 , and my comment here https://github.com/nestjs/nest/issues/255#issuecomment-361568409 which is the same as your issue.

but as kamil decided to not doing so in the core of the framework, and we need to support this through 3rd party modules, so I created nest-router a little module that will help you to organize your Routes and it Will give you the ability to create a routes tree.
you should have a look at README file, and the examples folder.

All 3 comments

Hay @menme95

actually your question was asked some time ago but in another format, and it was along discussion you could check it out here #255 , and my comment here https://github.com/nestjs/nest/issues/255#issuecomment-361568409 which is the same as your issue.

but as kamil decided to not doing so in the core of the framework, and we need to support this through 3rd party modules, so I created nest-router a little module that will help you to organize your Routes and it Will give you the ability to create a routes tree.
you should have a look at README file, and the examples folder.

As @shekohex mentioned, use nest-router: https://github.com/shekohex/nest-router

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VRspace4 picture VRspace4  路  3Comments

mishelashala picture mishelashala  路  3Comments

2233322 picture 2233322  路  3Comments

breitsmiley picture breitsmiley  路  3Comments

marshall007 picture marshall007  路  3Comments