diff --git a/_includes/api/en/5x/app-use.md b/_includes/api/en/5x/app-use.md index 8b5a2b13cc..5329088907 100644 --- a/_includes/api/en/5x/app-use.md +++ b/_includes/api/en/5x/app-use.md @@ -139,6 +139,22 @@ app.use(['/abcd', '/xyza', /\/lmn|\/pqr/], (req, res, next) => { +> **Note:** The above path examples describe how `app.use()` matches paths. +> When using route methods (such as `app.get()`, `app.post()`, etc.), the path must match exactly. +> For example: +> +> ```js +> app.use('/api', (req, res, next) => { +> // Matches /api, /api/users, /api/orders/123 +> next() +> }) +> +> app.get('/api', (req, res) => { +> // Only matches /api +> res.send('Hello API') +> }) +> ``` + #### Middleware callback function examples The following table provides some simple examples of middleware functions that