Make controller compatible with express versions 4 and 5#213
Open
ushkarev wants to merge 1 commit intoHMPO:masterfrom
Open
Make controller compatible with express versions 4 and 5#213ushkarev wants to merge 1 commit intoHMPO:masterfrom
ushkarev wants to merge 1 commit intoHMPO:masterfrom
Conversation
- `express` 4’s router methods allow wildcard paths in the form `'*'` - `express` 5’s router methods require wildcard placeholders in paths to be named, eg. `'*allPaths'` - …and there is no wildcard syntax that is common to both. For example, `express` 4 treats `'*allPaths'` as requiring the text “allPaths” to appear in the URL path. However, both allow specifying a `RegExp` object directly, thereby bypassing the use of differing versions of `path-to-regexp` (which are used under the hood on string paths).
Author
|
I ran the tests locally against 4 and 5 and they both seem happy. I didn’t want to mess with your workflows so didn’t add anything to What do you think about this approach? Alternatives I considered:
|
This was referenced Jun 25, 2025
Author
|
@cmcgee4801995 I notice you’ve made some recent commits to this repo… what do you think about this PR? |
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.
express4’s router methods allow wildcard paths in the form'*'express5’s router methods require wildcard placeholders in paths to be named, eg.'*allPaths'express4 treats'*allPaths'as requiring the text “allPaths” to appear in the URL path.However, both allow specifying a
RegExpobject directly, thereby bypassing the use of differing versions ofpath-to-regexp(which are used under the hood on string paths).This should address #208 but by different means.