Skip to content

Commit

Permalink
Update custom-routes-proxying to use fallback rewrites (#23610)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ijjk committed Apr 1, 2021
1 parent ba81b6a commit bfd36bd
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions 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*`,
},
],
}
},
}

0 comments on commit bfd36bd

Please sign in to comment.