From 0ea73ceeea6ce32ce38efcf086db70b0096f95f6 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa Date: Tue, 16 Apr 2024 16:00:28 +0530 Subject: [PATCH 1/2] fix: added envLoggingUrl to accept logging url from env, modified dev server host to 0.0.0.0 --- webpack.common.js | 20 ++++++++++++-------- webpack.dev.js | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index c6602f654..38994e92f 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -5,21 +5,20 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const CopyPlugin = require("copy-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const TerserPlugin = require("terser-webpack-plugin"); -const BundleAnalyzerPlugin = - require("webpack-bundle-analyzer").BundleAnalyzerPlugin; +const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin; const { sentryWebpackPlugin } = require("@sentry/webpack-plugin"); const sdkEnv = process.env.sdkEnv; const envSdkUrl = process.env.envSdkUrl; const envBackendUrl = process.env.envBackendUrl; +const envLoggingUrl = process.env.envBackendUrl; //git rev-parse --abbrev-ref HEAD let repoVersion = require("./package.json").version; let majorVersion = "v" + repoVersion.split(".")[0]; let repoName = require("./package.json").name; -let repoPublicPath = - sdkEnv === "local" ? "" : `/${repoVersion}/${majorVersion}`; +let repoPublicPath = sdkEnv === "local" ? "" : `/${repoVersion}/${majorVersion}`; let sdkUrl; @@ -64,10 +63,15 @@ if (envBackendUrl === undefined) { confirmEndPoint = envBackendUrl; } -let logEndpoint = - sdkEnv === "prod" - ? "https://api.hyperswitch.io/logs/sdk" - : "https://sandbox.hyperswitch.io/logs/sdk"; +let logEndpoint; +if (envLoggingUrl === undefined) { + logEndpoint = + sdkEnv === "prod" + ? "https://api.hyperswitch.io/logs/sdk" + : "https://sandbox.hyperswitch.io/logs/sdk"; +} else { + logEndpoint = envLoggingUrl; +} // Set this to true to enable logging let enableLogging = true; diff --git a/webpack.dev.js b/webpack.dev.js index 1c95cdd1b..39243e987 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -16,6 +16,7 @@ let backendEndPoint = let devServer = { contentBase: path.join(__dirname, "dist"), hot: true, + host: "0.0.0.0", port: 9050, historyApiFallback: true, proxy: { From fd27c7e9b603d57b2ed3de7060549e51a04aa985 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa Date: Tue, 16 Apr 2024 16:05:30 +0530 Subject: [PATCH 2/2] fix: rename envLoggingUrl --- webpack.common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.common.js b/webpack.common.js index 38994e92f..6802ee965 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -11,7 +11,7 @@ const { sentryWebpackPlugin } = require("@sentry/webpack-plugin"); const sdkEnv = process.env.sdkEnv; const envSdkUrl = process.env.envSdkUrl; const envBackendUrl = process.env.envBackendUrl; -const envLoggingUrl = process.env.envBackendUrl; +const envLoggingUrl = process.env.envLoggingUrl; //git rev-parse --abbrev-ref HEAD let repoVersion = require("./package.json").version;