main
Deploy Iddaai Frontend / build-and-deploy (push) Successful in 3m36s

This commit is contained in:
2026-05-05 14:06:01 +03:00
parent e3cc6702dd
commit 4df27e3e6d
10 changed files with 367 additions and 53 deletions
+13 -2
View File
@@ -2,16 +2,27 @@ import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const nextConfig: NextConfig = {
output: 'standalone',
output: "standalone",
experimental: {
optimizePackageImports: ["@chakra-ui/react"],
},
reactCompiler: true,
async rewrites() {
const apiUrl = process.env.NEXT_PUBLIC_API_URL;
if (!apiUrl) {
throw new Error("url is not defined");
}
// Remove the trailing /api to map uploads from the base backend url
const backendUrl = apiUrl.replace(/\/api\/?$/, "");
return [
{
source: "/api/backend/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3005/api'}/:path*`,
destination: `${apiUrl}/:path*`,
},
{
source: "/uploads/:path*",
destination: `${backendUrl}/uploads/:path*`,
},
];
},