Skip to content

Commit

Permalink
chore: Fix rewrites bug in next.config.js
Browse files Browse the repository at this point in the history
This commit fixes a bug in the `next.config.js` file related to rewrites. The rewrites for the `/2024` route were missing, causing incorrect redirection. This commit adds the missing rewrites for the `/2024` route, ensuring proper redirection.
  • Loading branch information
amkayondo committed May 20, 2024
1 parent d38e9d6 commit 4ab3c73
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions apps/2024/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,32 @@ module.exports = {
ignoreBuildErrors: true,
},
// fix the rewrites bug
// async rewrites() {
// return [
// {
// source: "/2023/:path*",
// destination: `${process.env.NODE_ENV
// === "development" ? "http://localhost:3002" : "https://ug.pycon.org"
// }/:path*`,
// },
// {
// source: "/2023",
// destination: `${process.env.NODE_ENV
// === "development" ? "http://localhost:3002" : "https://ug.pycon.org"
// }/:path*`,
// },
// {
// source: "/:path*",
// destination: `${process.env.NODE_ENV
// === "development" ? "http://localhost:3001" : "https://ug.pycon.org"
// }/:path*`,
// },
// ];
// },
async rewrites() {
return [
{
source: "/2023/:path*",
destination: `${process.env.NODE_ENV
=== "development" ? "http://localhost:3002" : "https://ug.pycon.org"
}/:path*`,
},
{
source: "/2023",
destination: `${process.env.NODE_ENV
=== "development" ? "http://localhost:3002" : "https://ug.pycon.org"
}/:path*`,
},
{
source: "/2024/:path*",
destination: `${process.env.NODE_ENV
=== "development" ? "http://localhost:3001" : "https://ug.pycon.org"
}/:path*`,
},
{
source: "/:path*",
destination: `${process.env.NODE_ENV
=== "development" ? "http://localhost:3001" : "https://ug.pycon.org"
}/:path*`,
},
];
},
};

0 comments on commit 4ab3c73

Please sign in to comment.