Skip to content

Allow multiple module paths on module Router #16052

@kr-78493

Description

@kr-78493

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

RouterModule does not allow to define an array of paths. This prevents me to access the same nested routes by different prefixes.

Describe the solution you'd like

Controllers allow the definition of multiple basePaths like this:
@Controller(['equipment/:assetId', 'assets/:assetId'])

I want to bring the same functionality to the RouteModule such that we can nest controllers like this:
RouterModule.register([ { path: ['equipment/:assetId', 'assets/:assetId'], module: AssetModule, } ]),

Teachability, documentation, adoption, migration strategy

These docs can be updated after the change has been implemented

https://docs.nestjs.com/recipes/router-module

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

I want to be able to rename the prefix of nested controllers to better reflect the changed business logic, while still being backwards compatible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions