Skip to content

docs: use an Express 5 compatible preflight wildcard - #433

Open
VictorMoni wants to merge 1 commit into
expressjs:masterfrom
VictorMoni:docs/express-5-preflight-wildcard
Open

VictorMoni wants to merge 1 commit into
expressjs:masterfrom
VictorMoni:docs/express-5-preflight-wildcard

Conversation

@VictorMoni

Copy link
Copy Markdown

The all-routes preflight example uses app.options('*', cors()), which throws Missing parameter name during route registration in Express 5.

Use /{*splat} for Express 5, explain that the braces include the root path, and retain the Express 4 syntax in the accompanying note.

Validation on Node.js 24.22.0:

  • Reproduced the original route-registration error in Express 5.
  • Verified real OPTIONS requests to /, /products/42, and /deep/nested/path with Express 5 (/{*splat}) and Express 4 (*). All returned 204, Access-Control-Allow-Origin: *, and allowed DELETE.
  • npm test passed: 49 tests, lint, and 100% coverage.
  • git diff --check passed.

Documentation only. Prepared and verified with AI assistance.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant