From 02e15cbea457672dc58b46ee8776d2adccb2c4c1 Mon Sep 17 00:00:00 2001 From: softsimon Date: Fri, 4 Feb 2022 13:47:34 +0400 Subject: [PATCH] Proxy all /api and /api/v1 requests to local nodejs server --- frontend/proxy.conf.local.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/proxy.conf.local.js b/frontend/proxy.conf.local.js index ba2248e5a..51365fc68 100644 --- a/frontend/proxy.conf.local.js +++ b/frontend/proxy.conf.local.js @@ -49,7 +49,14 @@ PROXY_CONFIG.map(conf => conf.target = "http://localhost:8999"); // Add rules for local backend if (backendConfigContent) { PROXY_CONFIG.push({ - context: ['/api/address/**', '/api/tx/**', '/api/block/**', '/api/blocks/**'], + context: ['/api/v1/**'], + target: `http://localhost:8999`, + secure: false, + changeOrigin: true, + proxyTimeout: 30000 + }); + PROXY_CONFIG.push({ + context: ['/api/**'], target: `http://localhost:8999`, secure: false, changeOrigin: true, @@ -57,15 +64,7 @@ if (backendConfigContent) { pathRewrite: { "^/api/": "/api/v1/" }, - }); - PROXY_CONFIG.push({ - context: ['/api/v1/**'], - target: `http://localhost:8999`, - secure: false, - changeOrigin: true, - proxyTimeout: 30000 }); - } console.log(PROXY_CONFIG);