From dd78da633f192cdb2e44864149c7aa4ff44965ec Mon Sep 17 00:00:00 2001 From: Steven Tey Date: Tue, 6 Sep 2022 09:52:53 -0500 Subject: [PATCH 1/4] Added comments to middleware-matcher example --- examples/middleware-matcher/middleware.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/middleware-matcher/middleware.js b/examples/middleware-matcher/middleware.js index 2d555ddfa773..9cfcf64d5acb 100644 --- a/examples/middleware-matcher/middleware.js +++ b/examples/middleware-matcher/middleware.js @@ -11,5 +11,8 @@ export default function middleware(req) { } export const config = { - matcher: ['/public/disclaimer', '/((?!public|static).*)'], + matcher: [ + '/public/disclaimer', // match a single, specific page + '/((?!public|static).*)' // match all pages not starting with 'public' or 'static' + ], } From 13af2078f449c5e8685e5050debc5f16591b1e5e Mon Sep 17 00:00:00 2001 From: Steven Tey Date: Mon, 12 Sep 2022 23:51:56 -0700 Subject: [PATCH 2/4] Update examples/middleware-matcher/middleware.js Co-authored-by: JJ Kasper --- examples/middleware-matcher/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/middleware-matcher/middleware.js b/examples/middleware-matcher/middleware.js index 9cfcf64d5acb..afd2e1e78e0d 100644 --- a/examples/middleware-matcher/middleware.js +++ b/examples/middleware-matcher/middleware.js @@ -13,6 +13,6 @@ export default function middleware(req) { export const config = { matcher: [ '/public/disclaimer', // match a single, specific page - '/((?!public|static).*)' // match all pages not starting with 'public' or 'static' + '/((?!public|static).*)' // match all paths not starting with 'public' or 'static' ], } From dc9dae36f2eec2a1e4821f025f85b7ffd5c2ee36 Mon Sep 17 00:00:00 2001 From: Steven Tey Date: Mon, 12 Sep 2022 23:52:57 -0700 Subject: [PATCH 3/4] Update examples/middleware-matcher/middleware.js Co-authored-by: JJ Kasper --- examples/middleware-matcher/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/middleware-matcher/middleware.js b/examples/middleware-matcher/middleware.js index afd2e1e78e0d..ec7954c96f8d 100644 --- a/examples/middleware-matcher/middleware.js +++ b/examples/middleware-matcher/middleware.js @@ -12,7 +12,7 @@ export default function middleware(req) { export const config = { matcher: [ - '/public/disclaimer', // match a single, specific page + '/disclaimer', // match a single, specific page '/((?!public|static).*)' // match all paths not starting with 'public' or 'static' ], } From 9faa377975413011e9c23e569f2771f07a4e3fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Tue, 13 Sep 2022 13:30:16 +0200 Subject: [PATCH 4/4] Apply suggestions from code review --- examples/middleware-matcher/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/middleware-matcher/middleware.js b/examples/middleware-matcher/middleware.js index ec7954c96f8d..a14196a4ccf3 100644 --- a/examples/middleware-matcher/middleware.js +++ b/examples/middleware-matcher/middleware.js @@ -13,6 +13,6 @@ export default function middleware(req) { export const config = { matcher: [ '/disclaimer', // match a single, specific page - '/((?!public|static).*)' // match all paths not starting with 'public' or 'static' + '/((?!public|static).*)', // match all paths not starting with 'public' or 'static' ], }