Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

express 5 router wildcard does not work as documented #1408

Closed
david-gang opened this issue Mar 16, 2023 · 7 comments
Closed

express 5 router wildcard does not work as documented #1408

david-gang opened this issue Mar 16, 2023 · 7 comments
Assignees
Labels
5.x Docs for 5.x version

Comments

@david-gang
Copy link

david-gang commented Mar 16, 2023

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

@dougwilson dougwilson transferred this issue from expressjs/express Mar 16, 2023
@david-gang
Copy link
Author

@dougwilson I could open a PR with the documentation changes. English is not my mother tongue so i would prefer that a native english speaker will review the PR. What do you think ?

@crandmck crandmck added the 5.x Docs for 5.x version label Apr 29, 2024
@IamLizu
Copy link
Member

IamLizu commented Aug 14, 2024

Hey @david-gang 👋

Thank you for your contribution 🎉

You can start this, if you are still here, please respond and I think someone will assign this to you.

@david-gang
Copy link
Author

Hi,

I am not longer using express actively.

Sorry,

@IamLizu
Copy link
Member

IamLizu commented Aug 16, 2024

Hey @david-gang 👋

Its fine.

In that case, I willing to fix it.

cc: @UlisesGascon

@IamLizu IamLizu self-assigned this Aug 20, 2024
@IamLizu
Copy link
Member

IamLizu commented Aug 22, 2024

Quick question, I have noticed that express 5.0 is not using path-to-regex, not listed as dependency.. Why is that?

Edit: It appears that express 5 is using router which is using path-to-regexp "3.2.0".

@IamLizu
Copy link
Member

IamLizu commented Sep 1, 2024

We already have PR for this which is ready to be landed,

@crandmck
Copy link
Member

crandmck commented Sep 2, 2024

Fixed by #1369

@crandmck crandmck closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.x Docs for 5.x version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants