docs: update pre-flight cors example according to v5#361
Open
IamLizu wants to merge 2 commits intoexpressjs:masterfrom
Open
docs: update pre-flight cors example according to v5#361IamLizu wants to merge 2 commits intoexpressjs:masterfrom
IamLizu wants to merge 2 commits intoexpressjs:masterfrom
Conversation
Member
|
express v4 is still supported (and has far more usage than v5 still). therefore, can you please update to show both examples? |
bjohansebas
reviewed
Jun 28, 2025
| For express v5, | ||
| ```javascript | ||
| // Catch every non-root path | ||
| app.options('/*splat', cors()); |
Member
There was a problem hiding this comment.
For most users, if not all, the root path is needed, so I think we should remove this.
Suggested change
| app.options('/*splat', cors()); |
Member
Author
There was a problem hiding this comment.
Example covering root path is also there if you read the next one or two line and both cases are clearly indicated with comments.
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.
Notes