Skip to content

docs: clarify path matching behavior for route methods vs app.use() (#1941)#2043

Closed
kushal4345 wants to merge 4 commits intoexpressjs:gh-pagesfrom
kushal4345:1941-docs-path-matching-note
Closed

docs: clarify path matching behavior for route methods vs app.use() (#1941)#2043
kushal4345 wants to merge 4 commits intoexpressjs:gh-pagesfrom
kushal4345:1941-docs-path-matching-note

Conversation

@kushal4345
Copy link
Copy Markdown
Contributor

This PR updates the documentation to address #1941 issue

Adds a note explaining that:

app.use() uses prefix-based path matching (e.g., /api will match /api/users).
HTTP method handlers (app.get(), app.post(), etc.) use exact path matching (e.g., app.get('/api') will only match /api).
Provides a clear code example to highlight the difference.
Ensures users are not confused when switching between app.use() and route methods.

This improves the clarity of the path examples section in the docs.

@kushal4345 kushal4345 requested a review from a team as a code owner August 19, 2025 04:20
@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 19, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit bcc071c
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/68a3fb82f275470008a797c1
😎 Deploy Preview https://deploy-preview-2043--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kushal4345
Copy link
Copy Markdown
Contributor Author

The Netlify preview is working fine, but the Lighthouse check is failing with a 404. Since this PR only changes documentation text, the Lighthouse failure seems unrelated. Could you please re-run or skip this check?

@kushal4345 kushal4345 closed this Aug 19, 2025
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.

1 participant