Skip to content

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

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)#2044
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:56
@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/68a4041defe7e20008657849
😎 Deploy Preview https://deploy-preview-2044--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.

@github-actions
Copy link
Copy Markdown
Contributor

🚦 Lighthouse Results (Mobile & Desktop)

URL Device Perf A11y Best Practices
/ mobile 🔴 64 🟢 100 🟠 79
/en/blog/posts.html mobile 🔴 71 🟢 96 🟢 93
/en/5x/api.html mobile 🔴 63 🟢 95 🟢 96
/ desktop 🟢 94 🟢 100 🟠 78
/en/blog/posts.html desktop 🟢 92 🟢 96 🟢 93
/en/5x/api.html desktop 🟢 93 🟢 95 🟢 96

@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