Skip to content

express 5 router wildcard does not work as documented #1408

@david-gang

Description

@david-gang

Hi,

The following does not work as written in the documentation:
https://expressjs.com/en/5x/api.html

app.all('*', requireAuthentication, loadUser)

This is because you are at a newer version of path-to-regexp

https://github.com/pillarjs/path-to-regexp#compatibility-with-express--4x

so please update the documentation because this works

app.all('(.*)', requireAuthentication, loadUser)

I think that also the migration doc should reflect this change.

Thanks

Metadata

Metadata

Assignees

Labels

5.xDocs for 5.x version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions