feat(RouterModule): add reolvePath
method to get controller full path.
#32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As @marsprince mentioned in his PR #31 that nestjs dosen't resolve or take into account
MODULE_PATH
metadata when it is coming to resolveController
path inMiddlewear
resolver.@marsprince introduced that we could have
controller
proprietary atRoute
interface that we could then override thePATH_METADATA
metadata value to the newmodulePath + controllerPath
in which as he said:..also make us lose ability to define own route in Decorator @Controller ..
and I really appreciate his hard work, but IMO that is not a good solution to mutate the metadata that i think will cues some unpredictable issues as MUTATING OTHER'S DATA IS NEVER BEEN A GOOD SOLUTION.so that i introduced a new fancy method
RouterModule#resolvePath
that will resolve the full path of any controller so instead of doing so:you should do
and that open us a new ideas like implementing something like as others discussing here nestjs/nest#1030 .
at that end thanks again to @marsprince 💙 .