Nest: System routing

Created on 22 May 2019  路  6Comments  路  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

The simple way to map routers in the NestJS

Expected behavior

The good behavior is a map many routers and the module responsible, example:

@Module({
    routers: [{
         path: '/other', 
         module:  OtherModule, 
         children: [{
              path: 'children', 
              module: ChildrenOtherModule
          }
       }],
    imports: [OtherModule],
    controllers: [AppController],
    providers: [AppService],
})
export class AppModule 
  • When I want to make a request GET in my backend on the specific module, I just use the path: [GET] http://api.com/other and the controller responsible in inside OtherModule will response

What is the motivation/use case for changing the behavior?

  • The Nestjs it's incredible frameworks for NodeJs, it's the best to NodeJS. But my application is booming, routers start to get confused

Environment



Nest version: 6.5.0


For Tooling issues:
Node version: 8.12.0
- Platform:  MacOs 10.14.5

Others:
* IntelliJ IDEA 2019.1.2 (Ultimate Edition)  Build #IU-191.7141.44, built on May 7, 2019
needs triage

Most helpful comment

abracadabra :ghost:, nest-router tada :tada: !

All 6 comments

abracadabra :ghost:, nest-router tada :tada: !

@shekohex: OMG this is amazing, I'm using in my project to solve the problem of many routers, but I think is a great idea this feature to be inside the framework.

.... but I think is a great idea this feature to be inside the framework.

we are discussing that here https://github.com/nestjs/nest/issues/1438

@lhenriquegomescamilo we'll provide it soon :)

Thank's everyone! :)

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

anyx picture anyx  路  3Comments

breitsmiley picture breitsmiley  路  3Comments

rafal-rudnicki picture rafal-rudnicki  路  3Comments

cojack picture cojack  路  3Comments

VRspace4 picture VRspace4  路  3Comments