diff --git a/next.config.ts b/next.config.ts index 3dd3515..6c9c50d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -45,6 +45,17 @@ const nextConfig: NextConfig = { unoptimized: true, }, transpilePackages: ["bioloom-ui", "bioloom-miniplayer"], + async rewrites() { + if (process.env.NEXT_PUBLIC_MODE === "DEV") { + return [ + { + source: "/api/v1/:path*", + destination: "https://d2jam.com/api/v1/:path*", + }, + ]; + } + return []; + }, }; // -- Apply and export -- diff --git a/src/requests/config.ts b/src/requests/config.ts index 14f5258..59fdfc5 100644 --- a/src/requests/config.ts +++ b/src/requests/config.ts @@ -1,4 +1,6 @@ export const BASE_URL = process.env.NEXT_PUBLIC_MODE === "PROD" ? "https://d2jam.com/api/v1" - : "http://localhost:3005/api/v1"; + : process.env.NEXT_PUBLIC_API === "prod" + ? "http://localhost:3000/api/v1" + : "http://localhost:3005/api/v1";