From 960704805cb74f469eb45d5ade690b2c1dae0f83 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 1 Apr 2021 11:37:35 -0500 Subject: [PATCH] Update custom-routes-proxying to use fallback rewrites --- .../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*`, + }, + ], + } }, }