From 59217a97968a57bb4de181e9756f2f414e8b7ffa Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 27 Aug 2024 11:35:43 +0300 Subject: [PATCH] docs: add a note about the middleware regular expression (#8742) --- .../app/advanced-development/api-routes/middlewares/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/apps/book/app/advanced-development/api-routes/middlewares/page.mdx b/www/apps/book/app/advanced-development/api-routes/middlewares/page.mdx index 32322ceb3f..8792bd99db 100644 --- a/www/apps/book/app/advanced-development/api-routes/middlewares/page.mdx +++ b/www/apps/book/app/advanced-development/api-routes/middlewares/page.mdx @@ -48,7 +48,7 @@ export default defineMiddlewares({ The `defineMiddlewares` function accepts a middleware configurations object that has the property `routes`. `routes`'s value is an array of middleware route objects, each having the following properties: -- `matcher`: a string or regular expression indicating the API route path to apply the middleware on. +- `matcher`: a string or regular expression indicating the API route path to apply the middleware on. The regular expression must be compatible with [path-to-regexp](https://github.com/pillarjs/path-to-regexp). - `middlewares`: An array of middleware functions. In the example above, you define a middleware that logs the message `Received a request!` whenever a request is sent to an API route path starting with `/store`.