expressjs / expressjs/cors

Allows CORS for any routes, including OPTIONS: documentation is obsolete

Open
#360 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
6.2k
Forks
512
PR merge metrics
No merged PRs in 30d

Description

### Description

Hi,

Since Express@5, we can no longer use the syntax `*` to apply a middleware to any route (source: https://expressjs.com/en/guide/migrating-5.html#path-syntax)

However, this middleware documentation still uses an example with it: `app.options('*', cors())` (source : https://github.com/expressjs/cors?tab=readme-ov-file#enabling-cors-pre-flight)

Could you update the documentation with the appropriate alternative?

### Expectations

The official alternative to allowing CORS for any route, including OPTIONS requests.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.