Skip to content

Commit

Permalink
Revert "remove rewrites from NextJS config (#5087)"
Browse files Browse the repository at this point in the history
This reverts commit ba3013e.
  • Loading branch information
gilluminate committed Jul 16, 2024
1 parent ba3013e commit d71fb95
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions clients/admin-ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@ const nextConfig = {
*/
proxyTimeout: 120000,
},
async rewrites() {
// The tests run without a server. Rewrites cause Next to continually try to connect,
// which spams the logs with "ECONNREFUSED".
if (process.env.NODE_ENV === "test") {
return [];
}

// these paths are unnecessarily complicated due to our backend being
// picky about trailing slashes https://github.com/ethyca/fides/issues/690
return [
{
source: `/api/v1/:path`,
destination: `${process.env.NEXT_PUBLIC_FIDESCTL_API_SERVER}/api/v1/:path/`,
},
{
source: `/api/v1/:first/:second*`,
destination: `${process.env.NEXT_PUBLIC_FIDESCTL_API_SERVER}/api/v1/:first/:second*`,
},
// The /health path does not live under /api/v1
{
source: `/health`,
destination: `${process.env.NEXT_PUBLIC_FIDESCTL_API_SERVER}/health`,
},
];
},
images: {
loader: "custom",
},
Expand Down

0 comments on commit d71fb95

Please sign in to comment.