Skip to content

Conversation

@kr-78493
Copy link

@kr-78493 kr-78493 commented Dec 11, 2025

The Router module allows defining multiple paths for a module. This enhancement updates the route resolution logic to accommodate multiple paths, ensuring that all specified paths are correctly registered and logged.

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, } ]),

Closes #16052

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The Router module allows defining multiple paths for a module. This enhancement updates the route resolution logic to accommodate multiple paths, ensuring that all specified paths are correctly registered and logged. Closes nestjs#16052
@coveralls
Copy link

Pull Request Test Coverage Report for Build 52e28be4-62ac-4c8b-b842-b656b80f3c58

Details

  • 24 of 25 (96.0%) changed or added relevant lines in 4 files are covered.
  • 38 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.5%) to 88.867%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/common/utils/shared.utils.ts 3 4 75.0%
Files with Coverage Reduction New Missed Lines %
packages/common/file-stream/streamable-file.ts 13 58.82%
packages/core/injector/topology-tree/tree-node.ts 25 13.79%
Totals Coverage Status
Change from base Build 1f224c4a-630b-4e8a-9967-d5934153bb78: -0.5%
Covered Lines: 7344
Relevant Lines: 8264

💛 - Coveralls
@kr-78493
Copy link
Author

@kamilmysliwiec Do you think that feature makes sense and has a chance of getting merged. If yes, I will add some additional tests and you can propose some changes if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants