🐛 fix: proxy requests through the web origin

This commit is contained in:
2026-08-13 02:19:14 +07:00
parent 1742f7321d
commit 83e52af412
7 changed files with 34 additions and 13 deletions
+17 -3
View File
@@ -4,7 +4,21 @@
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
}
async rewrites() {
const apiUrl = (process.env.API_URL || process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000")
.replace(/\/$/, "");
return [
{
source: "/auth/:path*",
destination: `${apiUrl}/auth/:path*`,
},
{
source: "/api/:path*",
destination: `${apiUrl}/api/:path*`,
},
];
},
};
export default nextConfig
export default nextConfig;