Skip to content

Commit d0d9466

Browse files
docs: regexp removed from middleware config (#85343)
Closes #84307 It seems that the `regexp` prop is not currently supported in the matcher object (./packages/next/src/build/segment-config/middleware/middleware-config.ts → MiddlewareMatcherInputSchema). Adjusting docs accordingly. --------- Co-authored-by: devjiwonchoi <devjiwonchoi@gmail.com>
1 parent 234984c commit d0d9466

File tree

1 file changed

+1
-3
lines changed
  • docs/01-app/03-api-reference/03-file-conventions

1 file changed

+1
-3
lines changed

docs/01-app/03-api-reference/03-file-conventions/proxy.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ Additionally, the `matcher` option supports complex path specifications through
8585
The `matcher` option accepts an array of objects with the following keys:
8686

8787
- `source`: The path or pattern used to match the request paths. It can be a string for direct path matching or a pattern for more complex matching.
88-
- `regexp` (optional): A regular expression string that fine-tunes the matching based on the source. It provides additional control over which paths are included or excluded.
8988
- `locale` (optional): A boolean that, when set to `false`, ignores locale-based routing in path matching.
9089
- `has` (optional): Specifies conditions based on the presence of specific request elements such as headers, query parameters, or cookies.
9190
- `missing` (optional): Focuses on conditions where certain request elements are absent, like missing headers or cookies.
@@ -94,8 +93,7 @@ The `matcher` option accepts an array of objects with the following keys:
9493
export const config = {
9594
matcher: [
9695
{
97-
source: '/api/*',
98-
regexp: '^/api/(.*)',
96+
source: '/api/:path*',
9997
locale: false,
10098
has: [
10199
{ type: 'header', key: 'Authorization', value: 'Bearer Token' },

0 commit comments

Comments
 (0)