From f52cfddfaefd22198df2e2750aa76aa506f419a5 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 1 Apr 2021 11:48:49 -0500 Subject: [PATCH] Update custom-routes-proxying to use fallback rewrites (#23610) This updates to use the new `fallback` rewrites support instead of the previous no-op rewrite workaround. ## Documentation / Examples - [x] Make sure the linting passes --- .../custom-routes-proxying/next.config.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/custom-routes-proxying/next.config.js b/examples/custom-routes-proxying/next.config.js index 34fbf87d7a25d..0ed1bef112c66 100644 --- a/examples/custom-routes-proxying/next.config.js +++ b/examples/custom-routes-proxying/next.config.js @@ -1,16 +1,12 @@ module.exports = { async rewrites() { - return [ - // we need to define a no-op rewrite to trigger checking - // all pages/static files before we attempt proxying - { - source: '/:path*', - destination: '/:path*', - }, - { - source: '/:path*', - destination: `https://custom-routes-proxying-endpoint.vercel.app/:path*`, - }, - ] + return { + fallback: [ + { + source: '/:path*', + destination: `https://custom-routes-proxying-endpoint.vercel.app/:path*`, + }, + ], + } }, }