From 837992f7ea847944a27904bb1e5c800bbdf172f2 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Fri, 22 Oct 2021 11:54:28 -0700 Subject: [PATCH] Route json assets based on the BASE_MODULE --- frontend/proxy.conf.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/proxy.conf.js b/frontend/proxy.conf.js index 4869935ff..65aa0df65 100644 --- a/frontend/proxy.conf.js +++ b/frontend/proxy.conf.js @@ -15,7 +15,6 @@ try { throw new Error(e); } else { console.log(`${CONFIG_FILE_NAME} file not found, using default config`); - } } @@ -61,4 +60,20 @@ PROXY_CONFIG = [ } ]; +if (configContent && configContent.BASE_MODULE == "liquid") { + PROXY_CONFIG.push({ + context: ['/resources/pools.json', '/resources/assets.json', '/resources/assets.minimal.json'], + target: "https://liquid.network", + secure: false, + changeOrigin: true, + }); +} else { + PROXY_CONFIG.push( { + context: ['/resources/pools.json', '/resources/assets.json', '/resources/assets.minimal.json'], + target: "https://mempool.space", + secure: false, + changeOrigin: true, + }); +} + module.exports = PROXY_CONFIG;