feat(core): add support for array of global prefixes#16101
Closed
malkovitc wants to merge 1 commit intonestjs:masterfrom
Closed
feat(core): add support for array of global prefixes#16101malkovitc wants to merge 1 commit intonestjs:masterfrom
malkovitc wants to merge 1 commit intonestjs:masterfrom
Conversation
Author
|
Closing to address additional issues found during review. Will reopen after fixing middleware and error handler support for multiple prefixes. |
Pull Request Test Coverage Report for Build 148c31b6-e053-4080-8c50-4316daa859cbDetails
💛 - Coveralls |
Author
|
Fixed and reopened as #16102 with additional support for middleware path extraction with multiple prefixes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Checklist
PR Type
What is the current behavior?
Issue Number: #16095
setGlobalPrefix()only accepts a single string prefix. Users who need to expose the same API under multiple base paths (e.g., for different deployment environments) previously used regex-style prefixes like(prefixOne|prefixTwo), which are no longer supported by path-to-regexp v8 in NestJS v11.What is the new behavior?
setGlobalPrefix()now accepts either a string or an array of strings:This provides a migration path for users who previously relied on regex-style prefixes.
Changes:
INestApplication.setGlobalPrefix()interface to acceptstring | string[]getGlobalPrefixes()method toApplicationConfigto retrieve all prefixesRoutePathFactoryto generate paths for each prefix in the arrayDoes this PR introduce a breaking change?
The change is backward compatible - existing code using a single string prefix will continue to work.