Skip to content

docs(migration): add slash for Express named wildcard #3258

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

Closed
wants to merge 1 commit into from

Conversation

sjoerdsmink
Copy link
Contributor

@sjoerdsmink sjoerdsmink commented May 9, 2025

Add slash for Express route matching syntax

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Docs
  • Other... Please describe:

What is the current behavior?

Incorrect mentioning of {*splat} that it is a named wildcard that matches any path including the root path. It actually does not include the root path. See the Express migration docs

Issue Number: N/A

What is the new behavior?

Adding a slash in the example, and mentioning that it doesn't include the root path.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Add slash for Express route matching syntax
@sjoerdsmink sjoerdsmink changed the title Update migration.md docs(migration): add slash for Express named wildcard May 9, 2025
@kamilmysliwiec
Copy link
Member

/ shouldn't be required IIRC

@sjoerdsmink
Copy link
Contributor Author

@kamilmysliwiec It's mentioned explicitly in the docs, in the note

*splat matches any path without the root path. If you need to match the root path as well /, you can use /{*splat}, wrapping the wildcard in braces.

@kamilmysliwiec
Copy link
Member

Nest adds / automatically though

@sjoerdsmink
Copy link
Contributor Author

Ok, I didn't know that, thanks. forRoutes seems to work without the slash as well.

@sjoerdsmink sjoerdsmink deleted the patch-2 branch May 12, 2025 07:21
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.

2 participants