Skip to content

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

Open
@simonrenoult-ra

Description

@simonrenoult-ra

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions